谌揆 发表于 2016-9-25 19:15:08

来大神看着这个为什么给我无限开单。

本帖最后由 谌揆 于 2016-9-25 19:20 编辑

int sell(double lots,string com,int sellmagic)
   {
   int a=0;
   bool zhaodan=false;
       for(int i=0;i<OrdersTotal();i++)
          {
             if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES==true))
               {
                  string zhushi=OrderComment();
                  int ma=OrderMagicNumber();
                  int type=OrderType();
                  if(OrderSymbol()==Symbol()&&OrderType()==OP_SELL && zhushi==com&&ma==sellmagic)
                  {
                     zhaodan==true;
                     break;
                  }
               }
          }
       if(zhaodan==false)
         {
            a=OrderSend(Symbol(),OP_SELL,lots,Bid,sip,0,0,com,sellmagic,Red);
         }
         return(a);
   }
               }
          }
       if(zhaodan==false)
         {
            a=OrderSend(Symbol(),OP_SELL,lots,Bid,sip,0,0,com,sellmagic,Red);
         }
         return(a);
   }


tempasdf 发表于 2016-9-25 22:31:54

&& 两边的条件 套括号试试
或两边的条件 结果 单独测试一下

柒侠伍义 发表于 2016-9-25 22:52:55

好啊...真正的自动EA....哈哈和

lyb2618 发表于 2016-9-25 23:00:42

不懂,飘过,,,,,,,

LZX 发表于 2016-9-26 00:07:39

学习学习

阳光总在风雨后 发表于 2016-9-26 07:48:50


不懂,飘过,,,,,,,
页: [1]
查看完整版本: 来大神看着这个为什么给我无限开单。