Params
Bool bInitStatues(false); // 初始化标志,修改初始仓位时需设置为True
Numeric InitMyRealMp(0); // 初始化当前仓位,正数表示多单,负数表示空单
Numeric FirstGrid(30); // 第一笔交易的间距,最小跳动;
Numeric AddGrid(5); // 加仓间距,最小跳动
Numeric TotalGrids(10); // 最大交易次数
Numeric TrailingGrid(30); // 移动止损间距,最小跳动
Numeric EveryLots(1); // 每次开仓手数
Numeric OffSet(1); // 委托价偏差,默认买卖价偏差为1个滑点
Numeric ExitOnCloseMins(14.58); //收盘平仓时间
Vars
Numeric HighAfterLongEntry;
Numeric LowAfterShortEntry;
Numeric MyRealMp(0);
Numeric MinPoint;
Numeric tmpPrice;
Numeric tmpLots;
Begin
MinPoint=Minmove*PriceScale;
MyRealMp=GetGlobalVar(0);
HighAfterLongEntry=GetGlobalVar(1);
LowAfterShortEntry=GetGlobalVar(2);
if (BarStatus0 And (MyRealMpInvalidNumeric || bInitStatues))
{
MyRealMp=I