公式测试不过去 楼主请看看原因
编译错误:无法判断该表达式的意图
箭头--- sell(1,holding,limitr,close);
公式测试不过去 楼主请看看原因
编译错误:无法判断该表达式的意图
箭头--- 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
出现错误 主要是因为大于号>有问题 ,更改了一下就可以了,更改后的代码如上,你可以复制粘贴试试
看了一下公式区的精华帖 ,发现我用的一这段代码改编自这里
http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=2160
1 variable:maxprofit=0;
2 win:=0;
3 win2:=0;
这3句都是什么意思啊??全不明白。请指教。