MQL4: Finding OHLC By Symbol Name

 

Hello all,

I am writing a script right now. I would like to get access to every symbol and every OHLC candle from that specific symbol. I am getting the symbol name by SymbolName(..., false); right now which is working well. I can see all the currencies I can trade with my basic script. I would like to get the OHLC candles by specifying that same sybmol. How do I do this?


Thanks

 
PublicImageLtd: I am writing a script right now. I would like to get access to every symbol and every OHLC candle from that specific symbol. I am getting the symbol name by SymbolName(..., false); right now which is working well. I can see all the currencies I can trade with my basic script. I would like to get the OHLC candles by specifying that same sybmol. How do I do this?

You can do it multiple ways, all of them described in the documentation section — Access to Timeseries and Indicator Data

Function

Action

CopyRates

Gets history data of the Rates structure for a specified symbol and period into an array

CopyOpen

Gets history data on bar opening price for a specified symbol and period into an array

CopyHigh

Gets history data on maximal bar price for a specified symbol and period into an array

CopyLow

Gets history data on minimal bar price for a specified symbol and period into an array

CopyClose

Gets history data on bar closing price for a specified symbol and period into an array

iClose

Returns Close price value for the bar of specified symbol with timeframe and shift

iHigh

Returns High price value for the bar of specified symbol with timeframe and shift

iLow

Returns Low price value for the bar of indicated symbol with timeframe and shift

iOpen

Returns Open price value for the bar of specified symbol with timeframe and shift