以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求助:引用的括号不完整  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=29739)

--  作者:wood3559
--  发布时间:2012/10/11 9:48:34
--  求助:引用的括号不完整
你好,我在编写一下公式时通不过编译,还请帮忙看看。

ratio:=....

If Position=0 and BARPOS>N Then Begin

//建立多头进场条件
Long := ratio>0;
if long then begin
myEntryPrice:=close;
buy( 1,PosNum,limitr,myEntryPrice);
Position:= 1 ;
int_stoploss:=close-p*atr*MULTIPLIER;
barNum:=BARPOS;
end 

//建立空头进场条件
Short := ratio < 0 ;
if short and Position=0 then begin
myEntryPrice:=close;
buyshort(1,PosNum,limitr,myEntryPrice);
Position := -1 ;
int_stoploss:=close+p*atr*MULTIPLIER;
barNum:=BARPOS;
end
End  //If

显示的问题是“引用的括号不完整”。我仔细看了下,也就buy和buyshort中引用了括号,但也是按照公式引用的。
实在找不到问题所在,还请帮助。多谢

--  作者:董小球
--  发布时间:2012/10/11 10:04:37
--  
你的END 后面要加分号啊
--  作者:wood3559
--  发布时间:2012/10/11 10:11:28
--  
多谢,果然是这个问题。。。