以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  老师,编不下去了,麻烦老师了  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=87203)

--  作者:么么
--  发布时间:2015/11/12 8:58:09
--  老师,编不下去了,麻烦老师了
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元时全部平仓


谢谢老师!!!!

--  作者:jinzhe
--  发布时间:2015/11/12 9:05:53
--  
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;


--  作者:么么
--  发布时间:2015/11/12 9:16:13
--  
在第1次开仓点上方5点再成交1手多单,(注:第1次开仓到第1次开仓价上方5点的这中间再不开仓)在第2次开仓点上方5点再成交1手(注:第2次开仓到第2次开仓价上方5点的这中间再不开仓,如此类推,当日成交30次后不再成交。
--  作者:jinzhe
--  发布时间:2015/11/12 9:27:24
--  
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


--  作者:么么
--  发布时间:2015/11/12 10:06:40
--  
老师,我按照你写的,我写了一个开空的,怎么图表上不出平空信号??
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

--  作者:么么
--  发布时间:2015/11/12 10:30:51
--  
??  ??? ??
--  作者:jinzhe
--  发布时间:2015/11/12 10:31:56
--  
平空是holding<0
--  作者:么么
--  发布时间:2015/11/12 11:06:37
--  
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次,老师,你看一下对吗??

--  作者:jinzhe
--  发布时间:2015/11/12 11:12:07
--  

一天只成交一次?

代码最后加一句

if time=closetime(0) then n:=0;

用来重置全局变量

 

还有图表全局变量用variable就可以了


--  作者:么么
--  发布时间:2015/11/12 11:36:50
--  
老师,lmt用在图表上应该是怎么样的??