oo:=VALUEWHEN(todaybar=1,o);
if c>oo and c>ma(c,60) then buy(1,1,market);
if ENTERPRICE>5 and ALLTICK(30 , ) then buy(1,1,market);
if openprofit>500 then sell(1,0,limitr,close);
在开盘价and60日均价线上方开立成交1手多单,在第1次开仓点上方5点再成交1手多单,在第2次开仓点上方5点再成交1手,如此类推,当日成交30次后不再成交。平仓:持仓>500元时全部平仓
谢谢老师!!!!
variable:n=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
if c>oo and c>ma60 and n<30 then begin
buy(1,1,market);
n:=n+1;
end
if openprofit>500 and holding>0 then begin
sell(1,0,market);
end
if time=closetime(0) then n:=0;
variable:n=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
if c>oo and c>ma60 then begin
buy(holding=0,1,market);
end
if c>enterprice+5 and n<30 then begin
buy(1,1,market);
n:=n+1;
end
if openprofit>500 and holding>0 then begin
sell(1,0,market);
end
if time=closetime(0) then begin
n:=0;
end
老师,我按照你写的,我写了一个开空的,怎么图表上不出平空信号??
variable:n=0;
oo:=VALUEWHEN(todaybar=1,o);
ma60:=ma(c,60);
if c<oo and c<ma60 then begin
BUYSHORT(holding=0,1,market);
end
if c<enterprice-5 and n<30 then begin
BUYSHORT(1,1,market);
n:=n-1;
end
if openprofit>500 and holding>0 then begin
sellshort(1,0,market);
end
if time=closetime(0) then begin
n:=0;
end
GLOBALVARIABLE:n=0;
GLOBALVARIABLE:tt=0;
oo:=VALUEWHEN(todaybar=1,o);
if c>oo and ma(c,60)+10*mindiff and n=0 and time>tt+15 then begin
BUYSHORT(1,10,market);
n:=1;
tt>TIME;
END
if openprofit>500 and holding<0 then begin
sellshort(1,0,market);
end
大于开盘价and60日均线上方10个点开1手空,当日周期只成交1次,老师,你看一下对吗??
一天只成交一次?
代码最后加一句
if time=closetime(0) then n:=0;
用来重置全局变量
还有图表全局变量用variable就可以了