Is it not possible to Chart.DrawIcon only from a cBot?
Is it not possible to Chart.DrawIcon only from a cBot?
27 Apr 2021, 18:38
I think the title says it all. :)
If I use an indicator, I can use Draw.ChartIcon and see arrows and stuff. If I put the same line into the OnBar() of a cBot, it's not working. Do I make a mistake or is this on purpose?
(Sorry, Im new to all this)
Thanks!
Replies
belasto
28 Apr 2021, 12:51
( Updated at: 21 Dec 2023, 09:22 )
RE:
In the indicators Calculate function - working:
Chart.DrawIcon("arrow", ChartIconType.DownArrow, index, Bars[index].High + 5 * Symbol.PipSize, Color.Red);
In the cBot onBar function - not working, I let it run in backtesting, so onBar() is being called:
Chart.DrawIcon("arrow", ChartIconType.DownArrow, Bars.Count - 1, Bars[Bars.Count-1].High + 5 * Symbol.PipSize, Color.Red);
Thanks so much for helping out.
!!!! EDIT: If found the problem. I was not using the "visual mode" in backtesting... no wonder! Now it's working. Thanks!
@belasto
PanagiotisCharalampous
28 Apr 2021, 08:03
Hi belasto,
It should work on both. Please share your code and we will spot the mistake.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous