如何获取MT5交易平台上所有交易品种数据信息?

要添加评论,请登录注册
Sue01
9
Sue01  
例如在MT4交易平台我们可以获取到All market data,但是MT5不可以。想要能够拷贝下来该交易平台所有的交易品种数据
Tsungche Kuo
31
Tsungche Kuo  
Sue01:
例如在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
  • www.mql5.com
Market Info - Reference on algorithmic/automated trading language for MetaTrader 5
Sue01
9
Sue01  
boolapi:

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



Thank you so much for your help!
要添加评论,请登录注册