以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请版主等高手修改一下模型  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=30343)

--  作者:kiiik
--  发布时间:2012/11/2 20:02:41
--  请版主等高手修改一下模型
初始200万资金 满仓交易 每次开仓自动检索可用开仓的资金,进行满仓交易。平仓自动满仓反手,加载在个个周期都是一样的。都要满仓交易。

hi:=ref(hhv(h,20),1);
lo:=ref(llv(l,20),1);
entertime:=time<=144500;
exittime:=time>=145700;
buycond:=c>hi;
sellcond:=c<lo;
if holding>0 and (sellcond or exittime) then sell(1,1,market),orderqueue;
if holding<0 and (buycond or exittime) then sellshort(1,1,market),orderqueue;
if holding=0 and entertime and buycond then buy(1,1,market),orderqueue;
if holding=0 and entertime and sellcond then buyshort(1,1,market),orderqueue;

 


--  作者:RogarZ
--  发布时间:2012/11/4 12:25:01
--  

hi:=ref(hhv(h,20),1);
lo:=ref(llv(l,20),1);
entertime:=time<=144500;
exittime:=time>=145700;
buycond:=c>hi;
sellcond:=c<lo;
if holding>0 and (sellcond or exittime) then sell(1,0,market),orderqueue;
if holding<0 and (buycond or exittime) then sellshort(1,0,market),orderqueue;
if holding=0 and entertime and buycond then buy(1,0,market),orderqueue;
if holding=0 and entertime and sellcond then buyshort(1,0,market),orderqueue;

 


--  作者:kiiik
--  发布时间:2012/11/4 20:12:49
--  
以下是引用RogarZ在2012-11-4 12:25:01的发言:

hi:=ref(hhv(h,20),1);
lo:=ref(llv(l,20),1);
entertime:=time<=144500;
exittime:=time>=145700;
buycond:=c>hi;
sellcond:=c<lo;
if holding>0 and (sellcond or exittime) then sell(1,0,market),orderqueue;
if holding<0 and (buycond or exittime) then sellshort(1,0,market),orderqueue;
if holding=0 and entertime and buycond then buy(1,0,market),orderqueue;
if holding=0 and entertime and sellcond then buyshort(1,0,market),orderqueue;

这个不对的。

我就是这样做的。在个个周期的仓位都不同 如在1分钟能开18 手。10分钟只能开13手。

 


--  作者:kiiik
--  发布时间:2012/11/4 20:14:12
--  
如果全自动 你全仓 系统会给你减仓。
--  作者:jinzhe
--  发布时间:2012/11/5 9:22:48
--  
请往前查看k线图上的信号,估计是有所亏损所以导致仓位的减少
--  作者:kiiik
--  发布时间:2012/11/5 11:41:49
--  
以下是引用jinzhe在2012-11-5 9:22:48的发言:
请往前查看k线图上的信号,估计是有所亏损所以导致仓位的减少




这样搞怎么行啊。没交易怎么会亏损呢。你们什么价算的啊。收盘价?有些隔个合约跳空就大亏了。还怎么开仓。能不能只算当天的K线?

--  作者:jinzhe
--  发布时间:2012/11/5 13:24:28
--  
图表是虚拟的,图表上虚拟的算下来亏了,那么就会影响信号, 和实际账户没有关系