以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  麻烦大虾帮忙检查下程序?不知道怎么改了  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=52293)

--  作者:chockstick
--  发布时间:2013/5/22 10:46:53
--  麻烦大虾帮忙检查下程序?不知道怎么改了

参数名:

win1:60

win2:100

win3:120

out1:10

out2:30

out3:20

--------------------------------------------
{ NumericSeries Rulow;//开仓以来最低价
  NumericSeries Ruhigh;//开仓以来最高价
  Numeric windots1; //赢利点
  Numeric outdots1;//出场点
  Numeric windots2; //赢利点
  Numeric outdots2;//出场点
  }
 
Begin
//开空单
If(holding=0 and Open>close and time<143000) then begin
BUYSHORT(1,1,limitr,close);
END
Rulow=LLV(low,ENTERBARS);//获得开仓以来的最低价
windots1=ENTERPRICE-Rulow;//计算盈利点数
outdots1=close-Rulow;

//盈利离场
If(holding<0 and windots1>win1 and windots1<win2 and outdots1>out1) then begin
SELLSHORT(1,1,limitr,close);
elseif(holding<0  and windots1>win2 and windots1<win3 and outdots1>out2) then begin
SELLSHORT(1,1,limitr,close);
Elseif(holding<0 and windots1>win3) then BEGIN

SELLSHORT(1,1,limitr,close);
end
end
end

//止损离场
if(holding<0 and ((close-ENTERPRICE)>out3 or time>1456000)) then BEGIN
SELLSHORT(1,1,limitr,close);
end

//开多单
If(holding=0 and Open<close and time<143000)then BEGIN
BUY(1,1,limitr,close);
end
Ruhigh=HHV(High,ENTERBARS);//获得开仓以来的最低价
windots2=Ruhigh-ENTERPRICE;//计算盈利点数
outdots2=Ruhigh-close;

//盈利离场
If(holding>0 and windots2>win1 and windots2<win2 and outdots2>out1)then BEGIN
sell(1,1,limitr,close);
elseif(holding>0 and windots2>win2 and windots2<win3 and outdots2>out2) THEN BEGIN
sell(1,1,limitr,close);
Elseif(holding>0 and windots2>win3) THEN BEGIN
sell(1,1,limitr,close);
end
END
END

//止损离场
if(holding>0 and ((ENTERPRICE-close)>out3 or time>1456000))THEN BEGIN

sell(1,1,limitr,close);
end

运行的时候提示有错,不知道怎么改?


--  作者:lichenghu
--  发布时间:2013/5/22 11:11:42
--  

 您好,您运行的时候提示什么错!--------------------------------------------
{ NumericSeries Rulow;//开仓以来最低价
  NumericSeries Ruhigh;//开仓以来最高价
  Numeric windots1; //赢利点
  Numeric outdots1;//出场点
  Numeric windots2; //赢利点
  Numeric outdots2;//出场点
  }

您这些变量都没有定义,用variable定义下


--  作者:chockstick
--  发布时间:2013/5/22 11:19:52
--  

//盈利离场
If(holding<0 and windots1>win1 and windots1<win2 and outdots1>out1) then begin
SELLSHORT(1,1,limitr,close);
end
if(holding<0  and windots1>win2 and windots1<win3 and outdots1>out2) then begin
SELLSHORT(1,1,limitr,close);
end
if(holding<0 and windots1>win3) then BEGIN
SELLSHORT(1,1,limitr,close);
end

这个语句有错误吗?提示说begin后面缺少end


--  作者:chockstick
--  发布时间:2013/5/22 11:25:14
--  

好像自己后面少了个end,现在正常了,谢谢了


--  作者:chockstick
--  发布时间:2013/5/22 11:26:13
--  请问怎么调出2min的K线来?
如题
--  作者:lichenghu
--  发布时间:2013/5/22 11:28:17
--  

您好,在工具-选项里面的多秒周期换成2min。

快捷方式直接键盘精灵输2min