【问题标题】:What function would you use to list the symbols?你会用什么函数来列出符号?
【发布时间】:2021-05-20 22:06:49
【问题描述】:

有没有办法设置一个包含货币符号对列表的条件,并在满足该条件时发出警报?你会用什么函数来列出符号?提前致谢。下面的代码让您大致了解我正在尝试做什么。

      for(i=0;i<Bars; i++)
  {
//Want a list of symbols to scan multiple currency pairs for the following condition
    if(Symbol("EURUSD";"AUDCAD";"USDJPY")Close[i+1]>Close[i+2])

   {
   a=a+1;
//This is what I want to happen if condition is met
   Alert(Symbol()+" 1");
   }

【问题讨论】:

    标签: mql4


    【解决方案1】:

    您可以使用SymbolsTotalSymbolName 获取Market Watch 中所有交易品种的列表。下面的代码应该给你一个开始(虽然它会永久发出警报,但我认为你需要准确检查你想要警报的内容)。

    for(int i=0; i<SymbolsTotal(true); i++)
    {
       string currencySymbol=SymbolName(i,true);
       int a=0;
       for(j=0; j<iBars(currencySymbol,0); j++)
       {
          if(iClose(currencySymbol,0,j)>iClose(currencySymbol,0,j+1)) a++;
       {
       if(a>0) Alert(StringConcatenate(currencySymbol,":",IntegerToString(a)));
    }
    

    【讨论】:

      猜你喜欢
      • 2010-10-06
      • 1970-01-01
      • 2020-10-10
      • 2018-05-17
      • 1970-01-01
      • 2015-08-10
      • 1970-01-01
      • 2010-10-14
      • 1970-01-01
      相关资源
      最近更新 更多