-- 作者:123abc
-- 发布时间:2013/4/16 9:57:35
-- 请高手帮忙!
runmode:0; variable:cc=0; islast:=islastbar; bb:=c>o+0.6; ss:=c<o-0.6; if cc>0 and ss then cc:=0; if cc<0 and bb then cc:=0; if cc=0 and bb then cc:=1; if cc=0 and ss then cc:=-1; lcc:=ref(cc,1); if islast then att:=extgbdata(\'att\');
if (lcc>0 and cc<=0) or (islast and cc<=0 and barpos>att and tbuyholding(1)>0) then begin exitlong:1; if lcc>0 and cc<=0 and islast then extgbdataset(\'att\',barpos); end if (lcc<0 and cc>=0) or (islast and cc>=0 and barpos>att and tsellholding(1)>0) then begin exitshort:1; if lcc<0 and cc>=0 and islast then extgbdataset(\'att\',barpos); end if (lcc<=0 and cc>0) or (islast and cc>0 and barpos>att and tbuyholding(1)=0) then begin enterlong:1; if lcc<=0 and cc>0 and islast then extgbdataset(\'att\',barpos); end if (lcc>=0 and cc<0) or (islast and cc<0 and barpos>att and tsellholding(1)=0) then begin entershort:1; if lcc>=0 and cc<0 and islast then extgbdataset(\'att\',barpos); end
帮忙改成K线走完提前N秒下单信号消失次周期恢复持仓!
这是阿火的,及时下单信号消失次周期恢复吃仓!
帮忙修改!谢谢!
|
-- 作者:jinzhe
-- 发布时间:2013/4/16 10:11:54
--
zq:=2;//周期类型,2分钟就填2,3分钟就填3 ,5分钟就填5,10分钟就填10 tq:=5;//提前的秒数,最多提前60秒 lastopentm:=if(date<>ref(date,1),0,ref(openminutes(time),1));//上一根K线的开盘分钟数 ticktm:=dynainfo(207); abb:=(mod(ticktm,100)>=60-tq and (openminutes(ticktm)-lastopentm=zq-1 or (ticktm>=112900 and ticktm<=113000) or (ticktm>=151400 and ticktm<=151500))) or not(islastbar);
平仓条件加上ABB
|
-- 作者:123abc
-- 发布时间:2013/4/16 13:45:15
--
runmode:0; input:n1(4,1,100,1); input:n2(9,1,100,1); input:n3(18,1,100,1); ma1:=ma(close,n1); ma2:=ma(close,n2); ma3:=ma(close,n3);
zq:=2;//周期类型,2分钟就填2,3分钟就填3 ,5分钟就填5,10分钟就填10 tq:=5;//提前的秒数,最多提前60秒 lastopentm:=if(date<>ref(date,1),0,ref(openminutes(time),1));//上一根K线的开盘分钟数 ticktm:=dynainfo(207); abb:=(mod(ticktm,100)>=60-tq and (openminutes(ticktm)-lastopentm=zq-1 or (ticktm>=112900 and ticktm<=113000) or (ticktm>=151400 and ticktm<=151500))) or not(islastbar);
if holding=0 then begin if close>ma1 and ma1>ma2 and ma2>ma3 and abb then buy(1,1,limitr,close); end if holding=0 then begin if close<ma1 and ma1<ma2 and ma2<ma3 and abb then buyshort(1,1,limitr,close); end
if holding>0 and abb then begin if ma1<ma2 then sell(1,holding,limitr,close); end if holding<0 and abb then begin if ma1>ma2 then sellshort(1,holding,limitr,close); end
|