DrawHorizontalLine breaks optimization

Created at 12 Sep 2020, 10:54
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!
VL

vldmarton

Joined 26.08.2020

DrawHorizontalLine breaks optimization
12 Sep 2020, 10:54


Hello, I'd like to ask if there is any chance to keep drawing on chart even in optimization. I have this line:

Chart.DrawHorizontalLine("label", level, Color.Aqua, 1);

Which I use in backtesting to help me visualize levels where trades were open. But if I keep this line (not comment it out) and start optimization, I get a random number of empty results. All of the values are 0 for all results. As soon as I comment this out, I get normal results. It's a bit frustrating to always comment it out before optimization. Is there a way to write this so that I don't have to do this?

Thanks.


@vldmarton
Replies

PanagiotisCharalampous
14 Sep 2020, 08:13

Hi vldmarton,

You can check the RunningMode and skip this line in case of optimization.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

genappsforex
19 Oct 2020, 20:49

RE:

bool CanDraw= (This.RunningMode == RunningMode.VisualBacktesting || This.RunningMode == RunningMode.RealTime);

 


@genappsforex