在Ea上增加一个对冲保本后加仓怎么写

 

在这个ea上在对冲盈利保本后加仓怎么写进去!重要是对冲保本后在加仓!


string         Comm1="----------------------------";          //------------------------

string         Comm2="----------------------------";          //------------------------

string         对冲设置="----------------------------";
input int      HedgeMaxOrder=1;                               //对冲最大持单数
input int      HedgeMagic=9999;                               //对冲订单识别号
string         HedgeCustomComm="Hedge";                       //对冲注释
input          bool       HedgeSwtich=true;                   //对冲开关
input          double     HedgeLoss=15.0;                     //对冲亏损启动倍数
input          bool       DQFitter=true;                      //使用DQ信号过滤

input bool     HedgeBreakEvenFunction=true;                   //对冲单保本止损功能
input double   HedgeBEReapValue=2.5;                          //对冲单盈利N倍保证金激活保本
input double   HedgeBEValue=0.5;                              //对冲后保本N倍保证金

double         ActHedgeBEReapValue;                           //盈利激活
double         ActHedgeBEValue;                               //保本间隔

input bool     HedgeTrailingStopFunction=true;                //对冲单跟踪止损功能
input bool     DYFitter=true;                                 //使用DY信号过滤
input double   HedgeTSReapValue=10.0;                          //对冲盈利N倍保证金激活移动止盈
input double   HedgeTSTrackValue=9.99;                        //对冲单跟踪间隔N倍保证金
input int      HedgeTSStepValue=0;                            //对冲单跟踪步长
int            ActHedgeTSStepValue;

input bool     HedgeClosePartialFunction=true;                //对冲部分平仓功能
input double   HedgeLots_Min=0;                               //不对冲最小手数_<=0功能关闭



bool     CloseMinLotsFunction=false;                          //对冲最小手数平仓功能

struct Hedge
      {
      long      Type_Init;
      ulong     Ticket_Init;
      double    CurSL_Init;
      double    LastSL_Init;
      double    Lots_Init;
      double    Profit_Init;
      
      long      Type_Hedge;
      ulong     Ticket_Hedge;
      
      double    CurSL_Hedge;
      double    LastSL_Hedge;
      double    Lots_Hedge;
      double    Profit_Hedge;
      };
      
Hedge                      ActHedge[200];                             //实际对冲单数据库
int                        ActHedgeDim=0;

Hedge                      TempHedge[200];                            //中转对冲单数据库
int                        TempHedgeDim=0;
原因: