Print log in GetFitness does not work

Created at 28 Jun 2019, 03:48
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
NO

noppanon

Joined 17.05.2017

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;
        }

    }
}

 


@noppanon
Replies

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

PanagiotisCharalampous
01 Jul 2019, 12:07

Hi Noppapon,

This is not possible because GetFitness is called after cBot execution.

Best Regards,

Panagiotis


@PanagiotisCharalampous

noppanon
01 Jul 2019, 12:08

Hi Panagiotis,

   Thanks for you reply. Woud you suggest me how I can debug GetFitness?

Regards,

Noppanon


@noppanon