The spread in the past.

 

Hi,

SymbolInfoDouble() or MarketInfo() can give the current market spread

Is there a way to know what was the spread for previous 10 or 20 candles ? 

Thank you.

 
MT4: Only if you store it yourself.
Files:
spread.mq4  28 kb
 
Toufik:

Hi,

SymbolInfoDouble() or MarketInfo() can give the current market spread

Is there a way to know what was the spread for previous 10 or 20 candles ? 

Thank you.

https://www.mql5.com/en/docs/series/copyspread

Documentation on MQL5: Timeseries and Indicators Access / CopySpread
Documentation on MQL5: Timeseries and Indicators Access / CopySpread
  • www.mql5.com
The function gets into spread_array the history data of spread values for the selected symbol-period pair in the specified quantity. It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar. If you know the amount of data you need to copy, it should better be done to a statically...
 
Icham Aidibe: https://www.mql5.com/en/docs/series/copyspread
  1. Why are you posting a MT5 function? This is the MT4 forum.
  2. Please use the link button Use the link button See the difference? https://www.mql5.com/en/docs/series/copyspread
              Messages Editor