DrawHorizontalLine breaks optimization
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.
Replies
genappsforex
19 Oct 2020, 20:49
RE:
bool CanDraw= (This.RunningMode == RunningMode.VisualBacktesting || This.RunningMode == RunningMode.RealTime);
@genappsforex
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