以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 程序化交易实盘俱乐部 (http://weistock.com/bbs/list.asp?boardid=9) ---- 如何在信号确立后,每隔20秒执行一次开仓命令? (http://weistock.com/bbs/dispbbs.asp?boardid=9&id=167514) |
-- 作者:15024973998 -- 发布时间:2019/1/4 11:42:21 -- 如何在信号确立后,每隔20秒执行一次开仓命令? 在实际开仓过程中,为避免一次性委托所带来的过大点差,应该采取分成5次开仓,每次1/5仓,但是在程序执行开仓时,应该如何设置编程?望解答,万分感谢 |
-- 作者:风度翩翩 -- 发布时间:2019/5/27 16:43:54 -- abb1:=(time0-timetot0(dynainfo(207)))<=30*60-20*TN OR NOT(ISLASTBAR); IF TN<5 AND abb1 THEN begin if holding>0 then buy(1,0.2*手数,thisclose); if holding<0 then buyshort(1,0.2*手数,thisclose); TN:=TN+1 end 30分钟K图表上,轮询模式中 间隔1秒轮询1次
[此贴子已经被作者于2019/5/27 16:45:30编辑过]
|
-- 作者:风度翩翩 -- 发布时间:2019/5/27 17:13:59 -- B1:=0;B2:=0;B3:=0;B4:=0;B5:=0;TN:=1; abb1:=(time0-timetot0(dynainfo(207)))<=30*60-20*TN OR NOT(ISLASTBAR); IF TN<5 AND abb1 THEN begin if B1=0 AND holding>0 then BEGIN buy(1,0.2*手数,thisclose); B1:=1; TN:=TN+1; END if B1=0 AND holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);B1:=1; TN:=TN+1; END if B2=0 AND holding>0 then BEGIN buy(1,0.2*手数,thisclose); B2:=1; TN:=TN+1; END if B2=0 AND holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);B2:=1; TN:=TN+1; END if B3=0 AND holding>0 then BEGIN buy(1,0.2*手数,thisclose); B3:=1; TN:=TN+1; END if B3=0 AND holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);B3:=1; TN:=TN+1; END if B4=0 AND holding>0 then BEGIN buy(1,0.2*手数,thisclose); B4:=1; TN:=TN+1; END if B4=0 AND holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);B4:=1; TN:=TN+1; END if B5=0 AND holding>0 then BEGIN buy(1,0.2*手数,thisclose); B5:=1; TN:=TN+1; END if B5=0 AND holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);B5:=1; TN:=TN+1; END end 30分钟K图表上,轮询模式中 间隔1秒轮询1次
|
-- 作者:风度翩翩 -- 发布时间:2019/5/27 18:25:07 -- TN:=1; //M1:TIME0-TIMETOT0(DYNAINFO(207)),LINETHICK0;//剩余秒数 abb1:=(time0-timetot0(dynainfo(207)))<=TIME0-20 OR NOT(ISLASTBAR); IF TN=1 AND abb1 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);TN:=TN+1; END end abb2:=(time0-timetot0(dynainfo(207)))<=TIME0-40 OR NOT(ISLASTBAR); IF TN=2 AND abb2 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb3:=(time0-timetot0(dynainfo(207)))<=TIME0-60 OR NOT(ISLASTBAR); IF TN=3 AND abb3 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb4:=(time0-timetot0(dynainfo(207)))<=TIME0-80 OR NOT(ISLASTBAR); IF TN=4 AND abb4 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb5:=(time0-timetot0(dynainfo(207)))<=TIME0-100 OR NOT(ISLASTBAR); IF TN=5 AND abb5 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end |
-- 作者:风度翩翩 -- 发布时间:2019/5/27 18:34:42 -- TN:=1;T0:=REF(TIME0,1); //M1:TIME0-TIMETOT0(DYNAINFO(207)),LINETHICK0;//剩余秒数 abb1:=timetot0(dynainfo(207))>=T0+20 OR NOT(ISLASTBAR); IF TN=1 AND abb1 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose);TN:=TN+1; END end abb2:=timetot0(dynainfo(207))>=T0+40 OR NOT(ISLASTBAR); IF TN=2 AND abb2 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb3:=timetot0(dynainfo(207))>=T0+60 OR NOT(ISLASTBAR); IF TN=3 AND abb3 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb4:=timetot0(dynainfo(207))>=T0+80 OR NOT(ISLASTBAR); IF TN=4 AND abb4 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end abb5:=timetot0(dynainfo(207))>=T0+100 OR NOT(ISLASTBAR); IF TN=5 AND abb5 THEN begin if holding>0 then BEGIN buy(1,0.2*手数,thisclose); TN:=TN+1; END if holding<0 then BEGIN buyshort(1,0.2*手数,thisclose); TN:=TN+1; END end |
-- 作者:风度翩翩 -- 发布时间:2019/5/29 12:03:13 -- 我实现了。。。 |