本策略用在1分鐘日內交易
開多倉條件A:當天上午9:00后第一根K線是陽線,且C>ma60; 限制條件每天只在前6根線有信號才下單,(當天第二次下單是,第一單止贏或止損后,滿足以上條件再下第二單)
開空倉條件B:當天上午9:00后第一根K線是陰線,且C<ma60; 限制條件每天只在前6根線有信號才下單
多單出場策略一:
當天14:50全部平倉
虧損大于20跳平倉
贏利達到80跳平倉
空單則反之
不管多單還是空單只要連續虧損達到6次,那么第七次開倉手數為之前的3倍,直到盈利然后再恢復原來的倉位進行交易
以上請老師幫忙編寫,非常感謝!
variable:n=0,ss=1;
ma60:ma(c,60);
tt:=time<145000;
cond1:=(c>ma60 and todaybar<=6);
cond2:=(c<ma60 and todaybar<=6);
if cond1 and tt then buy(holding=0,ss,marketr);
if cond2 and tt then buyshort(holding=0,ss,marketr);
if holding>0 and h-enterprice>=80*mindiff then begin
sell(1,0,marketr);
n:=0;
ss:=1;
end
if holding>0 and l<=enterprice-20*mindiff then begin
sell(1,0,marketr);
n:=n+1;
end
if holding<0 and enterprice-l>=20*mindiff then begin
sellshort(1,0,marketr);
n:=0;
ss:=1;
end
if holding<0 and h-enterprice>=80*mindiff then begin
sellshort(1,0,marketr);
n:=n+1;
end
if n=6 and ref(n=5,1) then ss:=ss*3;
if time=145000 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end
if time=closetime(0) then begin
n:=0;
ss:=1;
end
現在看你的開倉條件有點看不懂?你的開倉條件是:全天的開倉取決于第一根是否陰陽,同時還要和ma60比較,之后的周期再怎么花樣都不影響開倉?