可以
将下单语句放在IF的条件判断下,满足 当前K线涨幅大于一定百分比
然后在执行下单。
这样的话,我想想
在强大的金字塔面前,It is so easy !
variable:cc=0;
ma5:=ma(c,5);
ma10:=ma(c,10);
if cc>0 and ma5<ma10 then begin
sell(1,1,thisclose);
cc:=0;
end
if cc<0 and ma5>ma10 then begin
sellshort(1,1,thisclose);
cc:=0;
end
if cc=0 and ma5>ma10 then begin
cc:=1;
kpos:=barpos;
buy((c-o/o<0.001),1,thisclose);
end
if cc=0 and ma5<ma10 then begin
cc:=-1;
kpos:=barpos;
buyshort((c-o)/o>-0.001,1,thisclose);
end
if holding=0 and cc=1 and barpos-kpos>=1 then buy(1,1,thisclose);//出信号时不符合开仓条件,则推迟1根K线开仓
if holding=0 and cc=-1 and barpos-kpos>=1 then buyshort(1,1,thisclose);