以下是引用newbasic在2010-8-24 18:53:19的发言:
公式测试不过去 楼主请看看原因
编译错误:无法判断该表达式的意图
箭头--- sell(1,holding,limitr,close);
别复制粘贴,需要那段 需要自己在金字塔里面打一遍。我用了止盈那一段代码:
if holding<0 then begin
//盈亏计算
if enterbars >0 then begin
win:=(enterprice-c)/enterprice*100;
if win>maxprofit then
maxprofit:=win;
win2:=(maxprofit-win)/maxprofit*100;
//空头初始止盈
//if win<-2 then
//sellshort(holding<0,holding,limitr,close);
//空头利润止盈
if win>4 then
sellshort(holding<0,holding,limitr,close);
//空头回撤止盈
// if win2>60 and openprofit >0 then
// sellshort(holding<0,holding,limitr,close);
end
end
if holding>0 then begin
//盈亏计算
if enterbars >0 then begin
win:=(enterprice-c)/enterprice*100;
if win>maxprofit then
maxprofit:=win;
win2:=(maxprofit-win)/maxprofit*100;
//多头初始止损
//if win<-2 then
// sell(holding>0,holding,limitr,close);
//多头利润止盈
if win>4 then
sell(holding>0,holding,limitr,close);
//多头回撤止盈
//if win2>60 and openprofit >0 then
// sell(holding>0,holding,limitr,close);
end
end
出现错误 主要是因为大于号>有问题 ,更改了一下就可以了,更改后的代码如上,你可以复制粘贴试试
[此贴子已经被作者于2010-8-24 21:20:16编辑过]