Setting a one second time delay to an indicator rather than a bar delay or tick delay

 

Hello,

I have an indicator that measures the spread on a tick basis and writes it out to a file in order to create a history.


However, given that prices and spreads are time series then in order to get accurate statistics for analysis one needs the intervals to be identical (ticks do not produce identical intervals).


Can someone please advise how to create such a delay. I am new to MQL so would really appreciate if the answer could be detailed.


Thank you kindly

R

 
ronstar:

Hello,

I have an indicator that measures the spread on a tick basis and writes it out to a file in order to create a history.


However, given that prices and spreads are time series then in order to get accurate statistics for analysis one needs the intervals to be identical (ticks do not produce identical intervals).


Can someone please advise how to create such a delay. I am new to MQL so would really appreciate if the answer could be detailed.


Thank you kindly

R

You could analyse data on per-second basis. This would not involve changing anything on MQL5 part but rather writing a proper parser for your output file. If you get more than one tick within a second you would choose the worst spread.

cheers.