cBots runs well while backtesting, but not on Optimazition

Created at 16 Oct 2020, 18:02
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!
xabbu's avatar

xabbu

Joined 20.07.2020

cBots runs well while backtesting, but not on Optimazition
16 Oct 2020, 18:02


Dear Panagiotis,

I want to end manual parameter value testing, which I have done until now with backtesting by handish alter the parameter value and run the backtest again and again..

If I use the cTrader Optimization feature and select to optimize only one variable, it runs extrem quickly through the test but does not make any trades.

Do I have to alter something in my code to allow optimization runs?

Or do you have an explanation on this behaviour and can suggest a solution?

Kindest regards,


@xabbu
Replies

xabbu
16 Oct 2020, 19:47

found it - no chart events allowed...

is there the possibility to check if the cBot is in optimization mode (like isBacktesting) or any other trick not to out comment the lines with chart.xxxx?

 

Kindest regards,


@xabbu

mparama
17 Oct 2020, 05:03

RE:

xabbu said:

found it - no chart events allowed...

is there the possibility to check if the cBot is in optimization mode (like isBacktesting) or any other trick not to out comment the lines with chart.xxxx?

 

Kindest regards,

 

 

if (RunningMode != RunningMode.Optimization)
{

.......Chart events.....

}


@mparama

xabbu
19 Oct 2020, 11:51

thank you very much, mparama!

was only aware of "isbacktesting" and your tip helped me to learn about these other functions...

xabbu


@xabbu