金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 2051|回复: 2

老师这个编译不通过!请帮改下

[复制链接]

48

主题

141

帖子

141

积分

等级: 免费版

注册:
2022-5-31
曾用名:
发表于 2023-6-9 09:59 | 显示全部楼层 |阅读模式
runmode:0;
input:length(20,5,60,5);
input:ratio(4,1,5,1);
variable:trend=0;
variable:stopprice=0;
prebarhigh:=ref(high,1);
prebarlow:=ref(low,1);
atr:=trimprice(ref(ema(high-low,length),1));
trailingstop:=ratio*atr;
if barpos>length and trend=0 then begin
trend:=1;
stopprice:=prebarlow-trailingstop;
drawicon(1,prebarlow-trailingstop,8,0);
drawtext(1,prebarlow-trailingstop,\'开多\',colorred,1);
end
if trend=1 then begin
if prebarlow-trailingstop>stopprice then
stopprice:=prebarlow-trailingstop;
if low<=stopprice then begin
trend:=-1;
stopprice:=prebarhigh+trailingstop;
drawicon(1,prebarhigh+trailingstop,9,0);
drawtext(1,prebarhigh+trailingstop,\'开空\',colorgreen,1);
end
stickline(close>=open,high,close,1,1,colorred);
stickline(close>=open,close,open,10,1,colorred);
stickline(close>=open,open,low,1,1,colorred);
stickline(close<open,high,open,1,0,colorred);
stickline(close<open,open,close,10,0,colorred);
stickline(close<open,close,low,1,0,colorred);
end
if trend=-1 then begin
if prebarhigh+trailingstop<stopprice then
stopprice:=prebarhigh+trailingstop;
if high>=stopprice then begin
trend:=1;
stopprice:=prebarlow-trailingstop;
drawicon(1,prebarlow-trailingstop,8,0);
drawtext(1,prebarlow-trailingstop,\'开多\',colorred,1);
end
stickline(close>=open,high,close,1,1,colorgreen);
stickline(close>=open,close,open,10,1,colorgreen);
stickline(close>=open,open,low,1,1,colorgreen);
stickline(close<open,high,open,1,0,colorgreen);
stickline(close<open,open,close,10,0,colorgreen);
stickline(close<open,close,low,1,0,colorgreen);
end
drawicon(trend=1,stopprice,10);
drawicon(trend=-1,stopprice,11);
回复

使用道具 举报

21

主题

1万

帖子

1万

积分

Rank: 8Rank: 8

等级: 超级版主

注册:
2021-5-18
曾用名:
FireScript
发表于 2023-6-9 10:01 | 显示全部楼层
编译时候已经明确提示你了 trend 不能作为变量名称,它是系统函数。你把所有的trend 换成其他变量名称就行了。
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

48

主题

141

帖子

141

积分

等级: 免费版

注册:
2022-5-31
曾用名:
 楼主| 发表于 2023-6-9 10:07 | 显示全部楼层
谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2025-6-14 12:44 , Processed in 0.098364 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表