NO
Print log in GetFitness does not work
28 Jun 2019, 03:48
Hi all,
It seem like it can't print log information on method GetFitness. See sample code below.
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class OnFitness : Robot
{
[Parameter("Param 1", DefaultValue = 0.0)]
public double Param1 { get; set; }
protected override void OnStart()
{
Print("Bot started");
}
protected override void OnStop()
{
Print("Bot stoped");
}
protected override double GetFitness(GetFitnessArgs args)
{
double fitness = 100;
Print("In GetFitness");
return fitness;
}
}
}
Replies
PanagiotisCharalampous
01 Jul 2019, 12:07
Hi Noppapon,
This is not possible because GetFitness is called after cBot execution.
Best Regards,
Panagiotis
@PanagiotisCharalampous

noppanon
28 Jun 2019, 03:52 ( Updated at: 21 Dec 2023, 09:21 )
Please see my optimization result below with log infomration.
How can I make Print command to print in GetFitness? I'd like to use it for debuging.
Regards,
Noppanon
@noppanon