以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 金字塔软件问题提交 (http://www.weistock.com/bbs/list.asp?boardid=2) ---- limitr交易函数必须要为系统控制符 (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=53680) |
|
-- 作者:fjasmin -- 发布时间:2013/7/6 12:12:55 -- limitr交易函数必须要为系统控制符 //作者FJASMIN //需要准备的中间变量 h30:=ref(hhv(h,30),1);//引用上个周期三十分钟以来的最高点 l30:=ref(llv(h,30),1); h20:=ref(hhv(h,20),1);//二十分钟线 l20:=ref(llv(h,20),1); //进仓的条件 long:=h30>h and time >093000 and time < 145200;//当现在的最高价超越了30分钟之前的最高价,(设置的时间区段是九点30分到下午两点52分为期货交易的高峰期) if long then begin sellshort(holding,0,holding,limitr,h30) //平掉前三十分钟的仓 buy(holding=0,limitr,1,h30); //开仓的价格要与30分钟前的价格相同 end partline (holding >0,h30,colorred); //建立多头的止损条件 longX:=l<h20 and holding>0; if longX then begin sell(1,0,limitr,h20); end //j建立空头进场的条件 short:=l <h30 and time>093000 and time < 145200; if short then begin sell(holding,0,0,limitr,h30);//平仓的价格与三十分钟的价格相同 buyshort(holding = 0,0,limitr,h30); partline (holding <0,h30,colorgreen); //建立了空头的止损条件 shortX:=h>h20 and holding<0; if shortX then begin sellshort (1,0,limitr,h20); end //收盘兼平仓的语句 sell(time > 145500 and holding 0,0,thisclose);//如果我们在手盘的时候还有多单的话,就以最后K线的收盘价平掉 sellshort(time>145500 and holding,0,0,thisclose);//如果我们手中有空单的话在当日交易结束的时候以K线的最后价格平掉 //实现全部清仓的目的? 持仓:holding,linethick0; 资产:asset,noaxis; 可用现金:cash(0),linethick0; |
|
-- 作者:a1121648703 -- 发布时间:2013/7/6 20:03:44 --
h20:=ref(hhv(h,20),1);//二十分钟线 //进仓的条件 long:=h30>h and time >093000 and time < 145200;//当现在的最高价超越了30分钟之前的最高价,(设置的时间区段是九点30分到下午两点52分为期货交易的高峰期) partline (holding >0,h30,colorred); //建立多头的止损条件 longX:=l<h20 and holding>0;
//j建立空头进场的条件 if short then if shortX then begin //收盘兼平仓的语句 sell(time > 145500 and holding >0,0,thisclose);//如果我们在手盘的时候还有多单的话,就以最后K线的收盘价平掉 持仓:holding,linethick0;
|
|
-- 作者:RogarZ -- 发布时间:2013/7/7 9:08:53 -- buy(holding=0,limitr,1,h30) 写反了 自己好好看下函数说明 应该是 buy(holding=0,1,limitr,h30)
[此贴子已经被作者于2013/7/7 9:09:15编辑过]
|
|
-- 作者:qwer123 -- 发布时间:2013/7/7 9:35:27 -- 思路没有问题,中间有点错误,如果是我我会这样写这个策略 //表头-------必要的说明
|