Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共12 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:请高手帮忙!

1楼
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秒下单信号消失次周期恢复持仓!

这是阿火的,及时下单信号消失次周期恢复吃仓!

 

帮忙修改!谢谢!

 

 

2楼
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

3楼
123abc 发表于:2013/4/16 10:21:34

开仓条件不加上ABB?

在K线走完模式,开仓和平仓都要提前N秒下单,并在信号消失后次周期恢复持仓!

 

4楼
123abc 发表于:2013/4/16 10:27:03

我要的效果是:

在K线走完模式,开仓和平仓都要提前N秒下单,并在信号消失后次周期恢复持仓!

 

5楼
jinzhe 发表于:2013/4/16 10:37:33
那全加上不就得了
6楼
123abc 发表于:2013/4/16 11:30:42

信号消失次周期不恢复持仓?

 

7楼
123abc 发表于:2013/4/16 13:25:29

顶!

8楼
jinzhe 发表于:2013/4/16 13:38:32
完整代码贴一下
9楼
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

10楼
jinzhe 发表于:2013/4/16 14:00:46

不能用图表,用后台

共12 条记录, 每页显示 10 条, 页签: [1] [2]


Powered By Dvbbs Version 8.3.0
Processed in 0.03296 s, 3 queries.