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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 同品种同周期组合策略的平仓问题

   

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


  共有7537人关注过本帖平板打印复制链接

主题:同品种同周期组合策略的平仓问题

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


加好友 发短信
等级:论坛游民 帖子:261 积分:1358 威望:0 精华:0 注册:2011/12/13 10:55:10
  发帖心情 Post By:2012/2/21 10:20:27    Post IP:119.137.0.67[只看该作者]

火哥。上面的平仓策略就是我程序里面写的。跟具体的LONGCOND和SHORTCOND的条件应该没有关系吧。因为是框架里面运行的,不是说是各自开平各自的单么。目前的问题是B策略平空开多的时候。就直接平了A策略的持仓。开平仓的源码就是最基本的模板如下:

 

A策略:

if abb then begin

if holding>0 then begin
 if longcond then
  sell(1,holding,thisclose);
end

if holding<0 then begin
 if shortcond  then
  sellshort(1,holding,thisclose);
end


If Longcond1  then
begin
buy(holding=0,1,thisclose);
end

If  shortcond1  then
begin
buyshort(holding=0,1,thisclose);
end

end

 

 

 

B策略:

 

if abb then begin

if holding>0 then begin
 if shortcond  then
  sell(1,holding,thisclose);
end

if holding<0 then begin
 if longcond  then
  sellshort(1,holding,thisclose);
end


if holding=0 then begin
 if longcond then
  buy(1,1,thisclose);
end

if holding=0 then begin
 if shortcond then
  buyshort(1,1,thisclose);
end

end

 

 

里面的ABB是火哥提前5秒的模板。


 回到顶部
总数 23 1 2 3 下一页