公式简介: 咱们提前说明一下此天财藏金策略模型仅供大家学习交流之用,尽管小编对多个品种合约进行测试有一定的盈利效果,但是在震荡走势中资产回撤值较大,因此实站性比较差,但做为交易参考之用还是可以的。由于该天财藏金策略较为简单,为了达到理想的效果可用于偏大一点的K线周期中,如60分钟等,在棉花中的界面如下:
天财藏金策略
从上图单方面来看该指标的开仓信号还算及时,还是往往平仓机会较差,难免出现较大的止损交易,不建议开启自动交易功能,可做为价咯走势的参考工具。如需实站策略可联系我们推荐适用你个人的策略,今天这款天财藏金策略就免FEI分享给各位了,》》 下载链接即可.. Params
Bool bInitStatues(false);
Numeric InitMyRealMp(0);
Numeric FirstGrid(30);
Numeric AddGrid(5);
Numeric TotalGrids(10);
Numeric TrailingGrid(30);
Numeric EveryLots(1);
Numeric OffSet(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 (BarStatus==0 And (MyRealMp==InvalidNumeric || bInitStatues))
{MyRealMp=InitMyRealMp;
}if (Date<>Date[1])
{HighAfterLongEntry=High;
LowAfterShortEntry=Low;
MyRealMp=0;
}Else
{HighAfterLongEntry=Max(HighAfterLongEntry,High);
LowAfterShortEntry=Min(Low,LowAfterShortEntry);
}
If (Time<ExitOnCloseMins/100)
{If ( MyRealMp>0 And HighAfterLongEntry-Low>=TrailingGrid*MinPoint
And(High-Low<TrailingGrid*MinPoint Or(High-Low>=TrailingGrid*MinPoint And close<Open)))
{tmpPrice=Max(HighAfterLongEntry-(TrailingGrid-OffSet)*MinPoint,Low);
tmpLots=Abs(MyRealMp*EveryLots);
Sell(tmpLots,tmpPrice);
MyRealMp=0;
LowAfterShortEntry=Low;
}Else
If ( MyRealMp<0 And High-LowAfterShortEntry>=TrailingGrid*MinPoint
And(High-Low<TrailingGrid*MinPoint Or(High-Low>=TrailingGrid*MinPoint And close>Open)))
{tmpPrice=Min(LowAfterShortEntry+(TrailingGrid+OffSet)*MinPoint,High);
tmpLots=Abs(MyRealMp*EveryLots);
BuyToCover(tmpLots,tmpPrice);
MyRealMp=0;
HighAfterLongEntry=0;
}
if (MyRealMp==0 And High-LowAfterShortEntry>=FirstGrid*MinPoint)
{tmpPrice=Min(LowAfterShortEntry+(FirstGrid+OffSet)*MinPoint,High);
tmpLots=EveryLots;
Buy(tmpLots,tmpPrice);
MyRealMp=1;
HighAfterLongEntry=High;
}Else
if (MyRealMp> 0 And MyRealMp <TotalGrids And High-LowAfterShortEntry>=(FirstGrid+MyRealMp*AddGrid)
*MinPoint)
{tmpPrice=Min(LowAfterShortEntry+(FirstGrid+MyRealMp*AddGrid+OffSet)*MinPoint,High);
tmpLots=EveryLots;
Buy(tmpLots,tmpPrice);
MyRealMp=MyRealMp+1;
}Else
if (MyRealMp==0 And HighAfterLongEntry-Low>=TrailingGrid*MinPoint )
{tmpPrice=Max(HighAfterLongEntry-(FirstGrid-OffSet)*MinPoint,Low);;
tmpLots=EveryLots;
SellShort(tmpLots,tmpPrice);
MyRealMp=-1;
LowAfterShortEntry=Low ;
}Else
if (MyRealMp< 0 And -1*MyRealMp <TotalGrids And HighAfterLongEntry-Low>=(FirstGrid+MyRealMp*AddGrid)
*MinPoint)
{tmpPrice=Max(HighAfterLongEntry-(FirstGrid-Abs(MyRealMp*AddGrid)-OffSet)*MinPoint,High);
tmpLots=EveryLots;
SellShort(tmpLots,tmpPrice);
MyRealMp=MyRealMp-1;
}}Else
If (Time>ExitOnCloseMins/100)
{If (MyRealMp>0)
{tmpLots=Abs(MyRealMp*EveryLots);
tmpPrice=Close;
Sell(tmpLots,tmpPrice);
MyRealMp=0;}
If(MyRealMp<0)
{tmpLots=Abs(MyRealMp*EveryLots);
tmpPrice=Close;
BuyToCover(tmpLots,tmpPrice);
MyRealMp=0;
}}
SetGlobalVar(0,MyRealMp);
SetGlobalVar(1,HighAfterLongEntry);
SetGlobalVar(2,LowAfterShortEntry);
Commentary('MyRealMp='+Text(MyRealMp));
Commentary('HighAfterLongEntry='+Text(HighAfterLongEntry));
Commentary('LowAfterShortEntry='+Text(LowAfterShortEntry));
End
|
