Experts: New Candle or Bar formation.

 

New Candle or Bar formation.:

This Bot detects the open of a new candle on any set timeframe, thereby making it easier to run a one-time code, place trades and call other functions. The code is written in the OnTick() function.

New Candle or Bar formation.

Author: Clinton Dennis Edem

 
Thank you for the code👍🏿, I've been having difficulty detecting new candle open.
 
I'm glad you found the code helpful. 
 
Nice 
 
DeeFrank #:
Thank you for the code👍🏿, I've been having difficulty detecting new candle open.
G0
 
Memunatu Jah #:
Nice 

Thanks. 

 
Comment the next code you'll like me to write.
 
Memunatu Jah #:
Nice 
What 
 
incompetent
 
jhqy #:
incompetent
test the code and tell me if it's not working well. test before you comment negatively.
 
Clinton Dennis Edem #:
test the code and tell me if it works badly. test before commenting negatively.

1. improperly initialised previous_time , the code will give a false alarm immediately on startup

2. expensive access to iTime on each tick.

3. not every tick forms a bar (rarely, but a tick can come on a day off, it's not a trade - just some internal server procedures)