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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 以下内容是版主以前的一个模板,初学有点看不懂,请老师解读一下,特别是红色的部分。谢谢!

   

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


  共有4218人关注过本帖平板打印复制链接

主题:以下内容是版主以前的一个模板,初学有点看不懂,请老师解读一下,特别是红色的部分。谢谢!

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


加好友 发短信
等级:黑侠 帖子:749 积分:0 威望:0 精华:0 注册:2016/9/4 18:09:26
以下内容是版主以前的一个模板,初学有点看不懂,请老师解读一下,特别是红色的部分。谢谢!  发帖心情 Post By:2016/9/8 15:54:30    Post IP:58.240.18.50[只看该作者]


Global variable: hold=drawnull;

cc800988:=holding;//这句放在信号稳定的地方,

MA5:MA(CLOSE,5);

MA10:MA(CLOSE,10);

buycond:= CROSS(MA5,MA10);
sellcond:= CROSS(MA10,MA5);

drawtextex(1,1,800,0,'虚拟持仓为:'+numtostr(cc800988,0));//在图表上输入虚拟持仓以便监控
if not(islastbar) or workmode<>1 then exit;//最后周期,工作模式
xiadan800988:=cc800988-hold;

if xiadan800988>0.5 then begin
cang:=min(xiadan800988,abs(hold));
if hold<0 then begin
tsellshort(1,cang,mkt,0,0,'800988'),allowrepeat;
debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平空 %.0f',cang);
end
cang:=xiadan800988+min(hold,0);
if cang>0 then begin
tbuy(1,cang,mkt,0,0,'800988'),allowrepeat;
debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开多 %.0f',cang);
end
end
if xiadan800988<-0.5 then begin
cang:=min(abs(xiadan800988),abs(hold));
if hold>0 then begin
tsell(1,cang,mkt,0,0,'800988'),allowrepeat;
debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 平多 %.0f',cang);
end
cang:=abs(xiadan800988)-max(hold,0);
if cang>0 then begin
tbuyshort(1,cang,mkt,0,0,'800988'),allowrepeat;
debugfile('D:\800988.txt',numtostr(hold,0)+' '+numtostr(cc800988,0)+' 开空 %.0f',cang);
end
end
hold:=cc800988;      怎么在最后定义?不解

[此贴子已经被作者于2016-9-8 15:56:23编辑过]

 回到顶部
总数 32 1 2 3 4 下一页