以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  真实交易如何改  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=750)

--  作者:beensu
--  发布时间:2010/1/25 0:34:53
--  真实交易如何改
 

input:NS(5,1,100,1);{ 回调比例}
持仓: holding;

tt0:=time<145000;
tt2:=time>145700;//收盘时间

SELLSHORT(tt0 and BP and 持仓<0,持仓,market);
SELLSHORT(tt0 and 持仓<0,持仓,Stopr, LLV(L,ENTERBARS)*(1+NS/100));
BUY(tt0 and BK and  持仓=0,20%,market);

SELL(tt0 and SP and 持仓>0,持仓,market);
SELL(tt0 and 持仓>0,持仓,Stopr, HHV(H,ENTERBARS)*(1-NS/100));
BUYSHORT(tt0 and SK and 持仓=0,20%,market);

 

有颜色部分如何改 真实交易


--  作者:bhwhui
--  发布时间:2010/1/25 1:51:18
--  

呵呵呵,没测试您的代码,眼睛看的,不知您试过没有,说说个人意见。

 

1:如果是日内,改为STP即可。

 

2:否则,不知您注意了测试时 跳空的 取值了没有 Low或者High=开盘价?这不合理。

 

3:如果是这样,需要区分的情况很多种,需要考虑Open,max,min(Stop价,close)的关系,还需考虑Isup,isDown 的开平顺序问题。

 

这个策略如果您写完美了,也请给我一份,谢谢。


--  作者:admin
--  发布时间:2010/1/25 1:54:36
--  

input:NS(5,1,100,1);{ 回调比例}
持仓: Tholding;

tt0:=currenttime<145000;
tt2:=currenttime>145700;//收盘时间

TSELLSHORT(tt0 and BP and 持仓<0,持仓,MKT);
TSELLSHORT(tt0 and 持仓<0,持仓,STP, LLV(L,TENTERBARS)*(1+NS/100));
TBUY(tt0 and BK and  持仓=0,20%,MKT);

TSELL(tt0 and SP and 持仓>0,持仓,MKT);
TSELL(tt0 and 持仓>0,持仓,STP, HHV(H,TENTERBARS)*(1-NS/100));
TBUYSHORT(tt0 and SK and 持仓=0,20%,MKT);

 

 

金字塔有关程式化交易的教程

http://www.weistock.com/bbs/dispbbs.asp?boardid=2&Id=124

 

看来你是都没仔细看过

[此贴子已经被作者于2010-1-25 1:55:38编辑过]