以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  开仓  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=87432)

--  作者:么么
--  发布时间:2015/11/18 13:29:12
--  开仓
老师,麻烦看一下,我现在写的是不是点位成交,而不是走完K的收盘价
variable:n1=0,n2=0,n3=0,n4=0,n5=0,n6=0,n7=0,n8=0,n9=0,n10=0,n11=0,n12=0,n13=0,n14=0,n15=0,n16=0,n17=0,n18=0,n19=0,n20=0,n21=0,n22=0,n23=0,n24=0,n25=0;
variable:tt1=0,tt2=0,tt3=0,tt4=0,tt5=0,tt6=0,tt7=0,tt8=0,tt9=0,tt10=0,tt11=0,tt12=0,tt13=0,tt14=0,tt15=0,tt16=0,tt17=0,tt18=0,tt19=0,tt20=0,tt21=0,tt22=0,tt23=0,tt24=0,tt25=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
 
if open<oo-2*mindiff and c<ma60 and n1=0 and time<>tt1 then begin
BUYSHORT(1,25,market);
n1:=1;
tt1:=time;
END
 

if open<oo-4*mindiff and c<ma60 and n2=0 and time<>tt2 and enterbars>0 then begin
BUYSHORT(1,24,market);
n2:=1;
tt2:=time;;
END
 
if open<oo-6*mindiff and c<ma60 and n3=0 and time<>tt3 and enterbars>0 then begin 
BUYSHORT(1,23,market);
n3:=1;
tt3:=time;
end

if open<oo-8*mindiff and c<ma60 and n4=0 and time<>tt4 and enterbars>0 then begin 
BUYSHORT(1,22,market);
n4:=1;
tt4:=time;
end

if open<oo-10*mindiff and c<ma60 and n5=0 and time<>tt5 and enterbars>0 then begin 
BUYSHORT(1,21,market);
n5:=1;
tt5:=time;
end

if open<oo-12*mindiff and c<ma60 and n6=0 and time<>tt6 and enterbars>0 then begin 
BUYSHORT(1,20,market);
n6:=1;
tt6:=time;
end
if open<oo-14*mindiff and c<ma60 and n7=0 and time<>tt7 and enterbars>0 then begin 
BUYSHORT(1,19,market);
n7:=1;
tt7:=time;
end

if open<oo-16*mindiff and c<ma60 and n8=0 and time<>tt8 and enterbars>0 then begin 
BUYSHORT(1,18,market);
n8:=1;
tt8:=time;
end

if open<oo-18*mindiff and c<ma60 and n9=0 and time<>tt9 and enterbars>0 then begin
BUYSHORT(1,17,market);
n9:=1;
tt9:=time;;
END
 
if open<oo-20*mindiff and c<ma60 and n10=0 and time<>tt10 and enterbars>0 then begin 
BUYSHORT(1,16,market);
n10:=1;
tt10:=time;
end

if open<oo-22*mindiff and c<ma60 and n11=0 and time<>tt11 and enterbars>0 then begin 
BUYSHORT(1,15,market);
n11:=1;
tt11:=time;
end

if open<oo-24*mindiff and c<ma60 and n12=0 and time<>tt12 and enterbars>0 then begin 
BUYSHORT(1,14,market);
n12:=1;
tt12:=time;
end

if open<oo-26*mindiff and c<ma60 and n13=0 and time<>tt13 and enterbars>0 then begin 
BUYSHORT(1,13,market);
n13:=1;
tt13:=time;
end
if open<oo-28*mindiff and c<ma60 and n14=0 and time<>tt14 and enterbars>0 then begin 
BUYSHORT(1,12,market);
n14:=1;
tt14:=time;
end

if open<oo-30*mindiff and c<ma60 and n15=0 and time<>tt15 and enterbars>0 then begin 
BUYSHORT(1,11,market);
n15:=1;
tt15:=time;
end

if open<oo-32*mindiff and c<ma60 and n16=0 and time<>tt16 and enterbars>0 then begin 
BUYSHORT(1,10,market);
n16:=1;
tt16:=time;
end
if open<oo-34*mindiff and c<ma60 and n17=0 and time<>tt17 and enterbars>0 then begin 
BUYSHORT(1,9,market);
n17:=1;
tt17:=time;
end

if open<oo-36*mindiff and c<ma60 and n18=0 and time<>tt18 and enterbars>0 then begin 
BUYSHORT(1,8,market);
n18:=1;
tt18:=time;
end

if open<oo-38*mindiff and c<ma60 and n19=0 and time<>tt19 and enterbars>0 then begin 
BUYSHORT(1,7,market);
n19:=1;
tt19:=time;
end

if open<oo-40*mindiff and c<ma60 and n20=0 and time<>tt20 and enterbars>0 then begin 
BUYSHORT(1,6,market);
n20:=1;
tt20:=time;
end

if open<oo-42*mindiff and c<ma60 and n21=0 and time<>tt21 and enterbars>0 then begin 
BUYSHORT(1,5,market);
n21:=1;
tt21:=time;
end

if open<oo-44*mindiff and c<ma60 and n22=0 and time<>tt22 and enterbars>0 then begin 
BUYSHORT(1,4,market);
n22:=1;
tt22:=time;
end

if open<oo-46*mindiff and c<ma60 and n23=0 and time<>tt23 and enterbars>0 then begin 
BUYSHORT(1,3,market);
n23:=1;
tt23:=time;
end

if open<oo-48*mindiff and c<ma60 and n24=0 and time<>tt24 and enterbars>0 then begin 
BUYSHORT(1,2,market);
n24:=1;
tt24:=time;
end

if open<oo-50*mindiff and c<ma60 and n25=0 and time<>tt25 and enterbars>0 then begin 
BUYSHORT(1,1,market);
n25:=1;
tt25:=time;
end
if time=closetime(0) and enterbars>0 then begin
n1:=0;
n2:=0;
n3:=0;
n4:=0;
n5:=0;
n6:=0;
n7:=0;
n8:=0;
n9:=0;
n10:=0;
n11:=0;
n12:=0;
n13:=0;
n14:=0;
n15:=0;
n16:=0;
n17:=0;
n18:=0;
n19:=0;
n20:=0;
n21:=0;
n22:=0;
n23:=0;
n24:=0;
n25:=0;


tt1:=0;
tt2:=0;
tt3:=0;
tt4:=0;
tt5:=0;
tt6:=0;
tt7:=0;
tt8:=0;
tt9:=0;
tt10:=0;
tt11:=0;
tt12:=0;
tt13:=0;
tt14:=0;
tt15:=0;
tt16:=0;
tt17:=0;
tt18:=0;
tt19:=0;
tt20:=0;
tt21:=0;
tt22:=0;
tt23:=0;
tt24:=0;
tt25:=0;
end

--  作者:jinzhe
--  发布时间:2015/11/18 13:42:40
--  

用的是market下单,那么下单价格就是取决于你下单时的市价,如果用固定轮询,那么就是触发时的市价,如果是走完k线,那么就是走完k线时的市价


--  作者:么么
--  发布时间:2015/11/18 13:49:49
--  
不是,老师,是到点就成交,不用等这根K线的收盘价
--  作者:jinzhe
--  发布时间:2015/11/18 13:58:24
--  

即时下单是吧?

用固定时间间隔模式,间隔设置1秒,就会即时触发


图片点击可在新窗口打开查看此主题相关图片如下:2.png
图片点击可在新窗口打开查看