下载MetaTrader 5

who can help me ~~~('for' - expressions are not allowed on a global scope)

要添加评论,请登录注册
注册为卖方开始盈利吧!
zero3489
7
zero3489 2014.04.12 08:56 

What went wrong, I am looking for a long time or have no clue

 

 who can help me ~~~

 

 thank ~~



//+------------------------------------------------------------------+

//|                              Martingale.mq4 

//|                             Copyright2014s 

//|                              

//+------------------------------------------------------------------+


string ea="zero"; 


extern string    separator0            = "------ Normal settings ------";


extern double TP          =20;

extern double maxspread   =0;

extern double magicNumber =7788999;



extern string    separator1            = "------ Martingale settings ------";


extern int    MartingaleType =0;

extern double LotMultiplier  =2;

extern int    MaxMartingale  =15;

extern double BaseLotSize    =0.1;

extern double LoopPoint      =30;



int WinCount=0;

int LossCount=0;


/////////////////////////////////////////////////////////////////////////////////////////////Martingale settings




for(int Count=OrdersHistoryTotal()=i,Count--)

 


{   

    {

      {

      OrderSelect(Count,SELECT_BY_POS,MODE_HISTORY);

      if(OrderSymbol() = Symbol() && OrderMagicNumber() == magicNumber);

      }

        {

          {

          if(OrderProfit() > 0 && LossCount == 0) WinCount ++;

          else if(OrderProfit() < 0 && WinCount = 0) LossCount ++;

          }

          

          {

          if(MartingaleType == 0) int LoopPoint = LossCount;                 // lot size calculation

          else if(MartingaleType == 1) LoopPoint = WinCount;                // lot size calculation

          }

          

          {

          if(LoopPoint > MaxMartingale) LoopPoint = MaxMartingale;   // lot size calculation

          double LotSize = BaseLotSize * MathPow(LotMultiplier,LoopPoint);   // lot size calculation

          }

          

          else break;

         } 

    

    }

 





/////////////////////////////////////////////////////////////////////////////////////////////Normal settings


int start()

   {


      if(OrdersTotal()==0)

         {

          OrderSend(Symbol(),OP_BUY,BaseLotSize,Ask, maxspread,Ask-LoopPoint*Point,Ask+TP*Point,""+ea+"",magicNumber,0,Green);

         }

        return(0);

   }



}



/////////////////////////////////////////////////////////////////////////////////////////////end

enbo lu
版主
1947
enbo lu 2014.04.15 15:18  

I think you should learn to code from the very begining...

要添加评论,请登录注册