In Calculate() method how to identify each bar instead of each tick
Created at 07 Jul 2020, 14:09
In Calculate() method how to identify each bar instead of each tick
07 Jul 2020, 14:09
I am using an indicator to alert me when it is oversold, and using IsLastBar helps me to understand the current bar but I keep getting alert every second that it is oversold, When I have the chart for 1 hour how can I tell to alert me only once and then only alert after the next bar? Thanks
As you advised - Calculate() is executed on every tick. Try checking if the last bar's open time has change since the last tick. This way your code will be executed only once per bar
Could you please share an example ?
PanagiotisCharalampous
07 Jul 2020, 14:15
Hi naveenwhy,
See below an example
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous