例如在MT4交易平台我们可以获取到All market data,但是MT5不可以。想要能够拷贝下来该交易平台所有的交易品种数据
Sue01:
例如在MT4交易平台我们可以获取到All market data,但是MT5不可以。想要能够拷贝下来该交易平台所有的交易品种数据
例如在MT4交易平台我们可以获取到All market data,但是MT5不可以。想要能够拷贝下来该交易平台所有的交易品种数据
below are mql5 sample code to fetch & output all symbol names & bid/ask prices
int ii=0,iSymDg=0; string strSymName="";
for(ii=0;ii<SymbolsTotal(false);ii++)
{
strSymName=SymbolName(ii,false);
iSymDg=(int)SymbolInfoInteger(strSymName,SYMBOL_DIGITS);
/// fetch & output all symbol names and bid/ask prices
Print(strSymName," ",DoubleToString(SymbolInfoDouble(strSymName,SYMBOL_BID),iSymDg)," ",
DoubleToString(SymbolInfoDouble(strSymName,SYMBOL_ASK),iSymDg));
}
for market info function reference:
https://www.mql5.com/en/docs/marketinformation
![Documentation on MQL5: Market Info Documentation on MQL5: Market Info](https://c.mql5.com/36/17/documentation-on-mql5-market-info.png)
Documentation on MQL5: Market Info
- www.mql5.com
Market Info - Reference on algorithmic/automated trading language for MetaTrader 5
boolapi:
Thank you so much for your help!
below are mql5 sample code to fetch & output all symbol names & bid/ask prices
int ii=0,iSymDg=0; string strSymName="";
for(ii=0;ii<SymbolsTotal(false);ii++)
{
strSymName=SymbolName(ii,false);
iSymDg=(int)SymbolInfoInteger(strSymName,SYMBOL_DIGITS);
/// fetch & output all symbol names and bid/ask prices
Print(strSymName," ",DoubleToString(SymbolInfoDouble(strSymName,SYMBOL_BID),iSymDg)," ",
DoubleToString(SymbolInfoDouble(strSymName,SYMBOL_ASK),iSymDg));
}
for market info function reference:
https://www.mql5.com/en/docs/marketinformation