以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  新手请教问题  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=76398)

--  作者:Franco2015
--  发布时间:2015/3/12 14:51:28
--  新手请教问题

我把李凯老师的演示代码在测试发现图表显示不正确如下图,代码要求收盘前平仓,但图平显示过了夜。代码和图如下,请指正!谢谢!

h30:=ref(hhv(h,30),1);
l30:=ref(llv(l,30),1);
h20:=ref(hhv(h,20),1);
l20:=ref(llv(l,20),1);
long:=h>h30 and time >093000 and time<144500;
if long then
begin
sellshort(holding<0,holding,limitr,h30);
buy(holding=0,1,limitr,h30);

end

partline(1,l30,colorGREEN);
LongX:=l<l20 and holding>0;
if LongX then
begin
Sell(1,0,limitr,l20);

end
Short:=l<l30 and time>093000 and time <144500;
if Short then
begin
Sell(holding>0,0,limitr,l30);
buyshort(holding=0,1,limitr,l30);
end
partline(1,h30,Colorred);

sell(time>145000 and holding>0,0,thisclose);
sellshort(time>145000 and holding<0,0,thisclose);

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

{
信号语句排列规则——先平后开
“费率设置”按钮——用于合理设置模型“费率”,以便在图形上正确输出如下帐户信息:

 

您可以在查看菜单->交易系统模板 中设置自己需要的模板
}

 


图片点击可在新窗口打开查看此主题相关图片如下:无标题.png
图片点击可在新窗口打开查看

 


--  作者:Franco2015
--  发布时间:2015/3/12 15:08:23
--  
知道原因了,是没有选择应用于图表。因以前使用TB,现使用金字塔有点不习惯。打扰了!