欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 大神麻烦帮忙看看哪出错了,第一次就这样,

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有2976人关注过本帖树形打印复制链接

主题:大神麻烦帮忙看看哪出错了,第一次就这样,

帅哥哟,离线,有人找我吗?
FireScript
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:14496 积分:0 威望:0 精华:0 注册:2017/7/4 13:40:18
  发帖心情 Post By:2021/3/16 15:59:32    Post IP:58.246.57.26[显示全部帖子]

 1.建议你下载下我们关于代码编写的视频教程。你上面的问题还是需要熟悉下基本编写规范,才能避免。
2.
除了没定义的部分。其他地方应该没有错误了。

h20:=ref(hhv(h,20),1);
h10:=ref(hhv(h,10),1);
L20:=ref(LLV(l,20),1);
l10:=ref(llv(l,10),1);
//多头建立条件
long=h>h20 and time>093000 and time <145000;
if long then
begin
sellshort(1,holding,limitr,h20);
buy(holding=0,ss,limitr,h20);
END
//多头止损条件
longx:=(l10 and holding>0);
if longx then
begin
sell (1,0,limitr,l10);
END

//线条颜色
partline (holding>0,l20,colorred);
partline (holding<0,h20,colorgreen);


//空头建立条件
short:=l<l20 and time >093000 and time <145000;
if short then
begin
sell(holding>0,0,li,itr,l20);
buyshort (holding=0,1,limitr,l20);
end;

//空头止损条件
shortx:=h<h10 and holding<0;
if shortx then

                begin

                sellshort (1,0,limitr,h10);

                end ;
//收盘前全部平仓
sell(time>145500 and holding>0,0,thisclose);
sellshort (time>145500 and holding <0,0,thisclose);


持仓:holding,linethick0;
资产:asset,noaxis;
可用现金:cash(0),linethick0;


代码结尾是“;”而不是“.”号。 
sell (1,0,limitr,l10).

开仓函数的参数要符合规范,可以在函数说明中具体看下。你在函数上右键-定位到参考位置就能看到函数说明了。这些参数不能随便写的。也不能错位。
sellshort(holding,0,holding,limitr,h20)
buy (holding=0,limitr,h20)

改成

sellshort(1,holding,limitr,h20);
buy(holding=0,ss,limitr,h20);



命数如织,当如磐石。
 回到顶部
帅哥哟,离线,有人找我吗?
FireScript
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:14496 积分:0 威望:0 精华:0 注册:2017/7/4 13:40:18
  发帖心情 Post By:2021/3/16 16:10:56    Post IP:58.246.57.26[显示全部帖子]

 可以加下培训群。群里不定期有培训课的。
99720338


命数如织,当如磐石。
 回到顶部