Count how many bars ago an event has occured

Olisipo  

Hi,


as the title says i wanted to get how many bars ago an event has occurred, does anyone have an idea on where to start. Thanks

Samuel Manoel De Souza  
Olisipo:

Hi,


as the title says i wanted to get how many bars ago an event has occurred, does anyone have an idea on where to start. Thanks

since you have the time of the event you can use iBarShift
https://www.mql5.com/en/docs/series/ibarshift

Documentation on MQL5: Timeseries and Indicators Access / iBarShift
Documentation on MQL5: Timeseries and Indicators Access / iBarShift
  • www.mql5.com
iBarShift - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Amine Abed  
Olisipo:

Hi,


as the title says i wanted to get how many bars ago an event has occurred, does anyone have an idea on where to start. Thanks

Like what kind of event ?
Ahmet Metin Yilmaz  
I wrote an answer here but it doesn't show up anymore. I actually don't understand what's wrong!
Fernando Carreiro  
Ahmet Metin Yilmaz #: I wrote an answer here but it doesn't show up anymore. I actually don't understand what's wrong!

Because your answer was about a another application and has nothing to do with MetaTrader. Your answer should be relevant to MQL and MetaTrader and not about another language on another application.

Ahmet Metin Yilmaz  
Fernando Carreiro #:

Because your answer was about a another application and has nothing to do with MetaTrader. Your answer should be relevant to MQL and MetaTrader and not about another language on another application.

Ok. Thank you Fernando. 
My goal was to accurately identify the problem and offer a solution.
Reason: