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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 以下策略为金字塔程序化双边策略(可开多,可开空),请老师更改为两个单边策略(只开空一个策略,只开多一个策略)

   

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


  共有3102人关注过本帖树形打印复制链接

主题:以下策略为金字塔程序化双边策略(可开多,可开空),请老师更改为两个单边策略(只开空一个策略,只开多一个策略)

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


加好友 发短信
等级:超级版主 帖子:14496 积分:0 威望:0 精华:0 注册:2017/7/4 13:40:18
  发帖心情 Post By:2021/1/4 9:54:23    Post IP:58.246.57.26[显示全部帖子]

 只开空
INPUT:N(55,1,100,1),SS(1,1,100,1),NMIN(10,1,100,1),LONG_CO(0.999,0.001,1.1,0.001),SHORT_CO(1.001,0.001,1.1,0.001);
BUYTIME:=TIME>OPENTIME(1) AND TIME<CLOSETIME(0)-NMIN*100;      //设置日内交易的开仓时段           
SELLTIME:=TIME>=CLOSETIME(0)-NMIN*100;                                     
UP_LINE:REF(HHV(H,N),1)*LONG_CO;                                             
DOWN_LINE:REF(LLV(L,N),1)*SHORT_CO;                                            
MIDDLE_LINE:(UP_LINE+DOWN_LINE)/2;                                            
                                                    
CONKK:L<=DOWN_LINE AND BUYTIME;                                                                                                                //设置平多条件
CONPK:C>MIDDLE_LINE;                                                                   

 
SELLSHORT(CONPK AND HOLDING<0,HOLDING,MARKET);
BUYSHORT(CONKK AND HOLDING=0,SS,MARKET);
IF SELLTIME THEN                                                                               //收盘前全部平仓
BEGIN
SELLSHORT(HOLDING<0,HOLDING,MARKET);
END



只开多
INPUT:N(55,1,100,1),SS(1,1,100,1),NMIN(10,1,100,1),LONG_CO(0.999,0.001,1.1,0.001),SHORT_CO(1.001,0.001,1.1,0.001);
BUYTIME:=TIME>OPENTIME(1) AND TIME<CLOSETIME(0)-NMIN*100;      //设置日内交易的开仓时段           
SELLTIME:=TIME>=CLOSETIME(0)-NMIN*100;                                        
UP_LINE:REF(HHV(H,N),1)*LONG_CO;                                           
DOWN_LINE:REF(LLV(L,N),1)*SHORT_CO;                                   
MIDDLE_LINE:(UP_LINE+DOWN_LINE)/2;                                             

CONKD:H>=UP_LINE AND BUYTIME ;                                                                                                 
CONPD:C<MIDDLE_LINE;                                                               
                                                               
SELL(CONPD AND HOLDING>0,HOLDING,MARKET);
BUY(CONKD AND HOLDING=0,SS,MARKET);

 IF SELLTIME THEN                                                                               //收盘前全部平仓
BEGIN
SELL(HOLDING>0,HOLDING,MARKET);
END



命数如织,当如磐石。
 回到顶部