老师你好,帮助睇下有没有写错,给修改一下!

 
.正文 {margin:0.0pt; margin-top:0.0pt; margin-bottom:0.0pt; margin-left:0.0pt; margin-right:0.0pt; text-indent:0.0pt; font-family:"Times New Roman"; font-size:10.0pt; color:Black; font-weight:normal; } H1 {margin:0.0pt; margin-top:12.0pt; margin-bottom:3.0pt; margin-left:0.0pt; margin-right:0.0pt; text-indent:0.0pt; font-family:"Arial"; font-size:18.0pt; color:Black; font-weight:bold; } H2 {margin:0.0pt; margin-top:12.0pt; margin-bottom:3.0pt; margin-left:0.0pt; margin-right:0.0pt; text-indent:0.0pt; font-family:"Arial"; font-size:16.0pt; color:Black; font-weight:bold; } H3 {margin:0.0pt; margin-top:12.0pt; margin-bottom:3.0pt; margin-left:0.0pt; margin-right:0.0pt; text-indent:0.0pt; font-family:"Arial"; font-size:14.0pt; color:Black; font-weight:bold; }

老师你好,帮助睇下有没有写错,给修改一下!部份内容来自网络。
英镑5分钟周期,MT4软件,

8均线上穿25均线开多,反之平仓,移动止损100点。

8均线下穿25均线开空,反之平仓,移动止损100点。

//---
input double           手数=0.03;
input double            止损=100;
input bool              反向平仓=false;
input bool               移动止损=false;
input int               多单提损=100;
input int               空单提损=100;
input int               移动止损幅度=100;
input bool              入场均线交叉开仓=true;
input ENUM_MA_METHOD    MA1类型=MODE_EMA;//入场快线类型
input int               MA1=8;//入场信号的快线
input ENUM_MA_METHOD    MA2类型=MODE_EMA;//入场慢线类型
input int               MA2=25;//入场信号的慢线
input int               滑点=15;
//---
int buyfuwei=多单提损;
int sellfuwei=空单提损;
//---
void OnTick()
  {
//定义均线值-------------------------------------------------------------------
   double ma1=iMA(Symbol(),0,MA1,0,MA1类型,PRICE_CLOSE,1);
   double ma2=iMA(Symbol(),0,MA2,0,MA2类型,PRICE_CLOSE,1);
//buy条件:出现反向信号平仓--------------------------------------------
   if (!入场均线交叉开仓 && ma1>ma2)))
     {
      if(反向平仓)
           {
            if(OrderSelect选择订单(i,SELECT_BY_POS,MODE_TRADES)) //选定当前持单
              {
               if((OrderComment()==(Symbol()+"sell"))) //如果持有空单注释一样  
                 {
                   bool odc=OrderClose(OrderTicket(),OrderLots(),Ask,滑点); //空仓平仓            
                 }
              }
           }
        }
           {
            if((buy(lots,止损,止盈,Symbol()+"buy",0)>0)&&(移动止损==true)) //下多单
              {
                 buyfuwei=多单提损;
              }
            }
      }
      
//sell条件:出现反向信号平仓-------------------------------------------------------------------
   if (!入场均线交叉开仓 && ma1<ma2)))
     {
      if(反向平仓)
           {
            if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
              {
               if((OrderComment()==(Symbol()+"buy")))
                 {
                   bool odc=OrderClose(OrderTicket(),OrderLots(),Bid,滑点);          
                 }
              }
           }
        }
           {
            if((sell(lots,止损,止盈,Symbol()+"sell",0)>0)&&(移动止损==true))
              {
                 sellfuwei=空单提损;
              }
           }
      }
  
//追踪止损设置-------------------------------------------------------------------
    if(移动止损==true)
                  {
                    if(((Bid-OrderOpenPrice())/Point)>=buyfuwei) //如果买价-开仓价/点数>=移动止损
                      {
                        double buysl=OrderStopLoss(); //获取订单止损价格
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),buysl+移动止损幅度*Point,OrderTakeProfit(),0)==true)
                        //修改止损:止损价+移动止损幅度
                          {
                            buyfuwei=buyfuwei+移动止损幅度; //从新赋值移动止损
                          }
                      }                
                  }
                if((OrderComment()==(Symbol()+"sell")))    
                  {
                    if(((OrderOpenPrice()-Ask)/Point)>=sellfuwei)
                      {
                        double sellsl=OrderStopLoss();
                        if(OrderModify(OrderTicket(),OrderOpenPrice(),sellsl-移动止损幅度*Point,OrderTakeProfit(),0)==true)
                          {
                           sellfuwei=sellfuwei+移动止损幅度;
                          }
                      }                
                  }
              }
          }
      }
  }

原因: