
等级: 专业版
- 注册:
- 2021-7-7
- 曾用名:
|

楼主 |
发表于 2022-9-19 09:54
|
显示全部楼层
请老师把我这个模型改为纯后台模型(我现是后台借用图表的持仓)——谢谢了!
zc:=ref(c,1);
支撑:llv(zc,120);
sj:093000;
hd:1;
开仓价:=enterprice;
HT开仓价:=Tenterprice;//后台
ss:100;
持多最高:=if(holding>0 ,hhv(h,enterbars),0);
持多最低:=if(holding>0 ,llv(l,enterbars),0);
HT持多最高:=if(Tholding>0 ,hhv(h,Tenterbars),0); //后台
HT持多最低:=if(Tholding>0 ,llv(l,Tenterbars),0); //后台
KDTJ:=cross(c,ma(c,30));
开多条件:(KDTJ ) and holding=0 ,linethick0;
HT开多条件:(KDTJ) and Tholding=0 ,linethick0;////后台
跌破支撑:=c<支撑 and c<开仓价;
HT跌破支撑:=c<支撑 and c<HT开仓价;//后台
止损条件:=l<开仓价*0.9;
止损价:=min(o,开仓价*0.9);
HT止损条件:=l<HT开仓价*0.9;//后台
HT止损价:=min(o,HT开仓价*0.9);//后台
p2:=if(islastbar,dynainfo(207),time);
p3:=time0-timetot0(p2),linethick0;
{后台和图表写在一起}
Tsell(holding>0 and 止损条件 and time<sj and barstatus=2,0,LMT,止损价-hd);
止损:sell(holding>0 and 止损条件 and time<sj and barstatus<2,0,limitr,止损价);
{后台和图表写在一起}
Tsell(holding>0 and enterbars>=1 and ref(跌破支撑,1) and barstatus=2 ,0,lmt,o-HD),COLORBLUe;
平多:sell(holding>0 and enterbars>=1 and ref(跌破支撑,1) and barstatus<2 ,0,limitr,o),COLORBLUe;
{后台和图表写在一起}
Tbuy(holding=0 and 开多条件 AND TIME>SJ and barstatus=2 and p3<15 ,ss,LMT,c+hd);
buy(holding=0 and (开多条件) AND TIME>SJ and barstatus<2 ,ss,limitr,c),colorFF00FF;
|
|