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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件交易策略发布专区 → [交易系统]恒温器策略

   

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


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

主题:[交易系统]恒温器策略

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[交易系统]恒温器策略  发帖心情 Post By:2011/10/3 11:17:12 [只看该作者]

图片点击可在新窗口打开查看

 

runmode:0;

input:bollingerlengths(50);
input:trendliqlength(50);
input:numstddevs(2);
input:swingprcnt1(0.5);
input:swingprcnt2(0.75);
input:atrlength(10);
input:swingtrendswitch(20);

variable:swing=false;

cmival:=abs(close-ref(close,30))/(hhv(high,30),1)-llv(low,30);

buyeasierday:=0;
selleasierday:=0;

trendlokbuy:=ma(low,3);
trendloksell:=ma(high,3);

keyofday:=(high+low+close)/3;

if close>keyofday then
 selleasierday:=1;
else
 buyeasierday:=1;
 
atr:=ma(tr,atrlength); 

if ref(buyeasierday,1)=1 then begin
 swingbuypt:=open+swingprcnt1*atr;
 swingsellpt:=open-swingprcnt2*atr;
end 

if ref(selleasierday,1)=1 then begin
 swingbuypt:=open+swingprcnt2*atr;
 swingsellpt:=open-swingprcnt1*atr;
end

swingbuypt:=max(swingbuypt,trendlokbuy);
swingsellpt:=min(swingsellpt,trendloksell);

ma1:=ma(close,trendliqlength);

mid:=ma(close,bollingerlengths);
trendbuypt:=mid+numstddevs*std(close,bollingerlengths);
trendsellpt:=mid-numstddevs*std(close,bollingerlengths);

if cmival<swingtrendswitch then begin
 if holding=0 then begin
  if high>=swingbuypt then begin
   buy(1,1,limitr,max(open,swingbuypt));
   swing:=true;
  end 
 end 
 
 if holding=0 then begin
  if low<=swingsellpt then begin
   buyshort(1,1,limitr,min(open,swingsellpt));
   swing:=true;
  end 
 end
 
 if holding>0 then begin
  if low<=swingsellpt then begin
   sell(1,holding,limitr,min(open,swingsellpt));
   buyshort(1,1,limitr,min(open,swingsellpt));
   swing:=true;
  end
 end
 
 if holding<0 then begin
  if high>=swingbuypt then begin
   sellshort(1,holding,limitr,max(open,swingbuypt));
   buy(1,1,limitr,max(open,swingbuypt));
   swing:=true;
  end
 end
end else begin
 swingprotstop:=3*atr;
 
 if holding=0 then begin
  if high>=trendbuypt then begin
   buy(1,1,limitr,max(open,trendbuypt));
   swing:=false;
  end 
 end
 
 if holding=0 then begin
  if low<=trendsellpt then begin
   buyshort(1,1,limitr,min(open,trendsellpt));
   swing:=false;
  end 
 end
 
 if holding>0 then begin
  if swing then begin
   if low<=enterprice-swingprotstop then
    sell(1,holding,limitr,min(open,enterprice-swingprotstop));
  end else begin
   if low<=ma1 then
    sell(1,holding,limitr,min(open,ma1));
  end
 end
 
 if holding<0 then begin
  if swing then begin
   if high>=enterprice+swingprotstop then
    sellshort(1,holding,limitr,max(open,enterprice+swingprotstop));
  end else begin
   if high>=ma1 then
    sellshort(1,holding,limitr,max(open,ma1));
  end 
 end
end

盈亏:asset-50000,noaxis,colorred,linethick2;


 回到顶部
帅哥哟,离线,有人找我吗?
jonathan
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:8 积分:0 威望:0 精华:0 注册:2016/7/30 23:12:23
  发帖心情 Post By:2016/12/26 14:48:49 [只看该作者]

最后一句话 -50000 是什么意思?

 回到顶部
帅哥哟,离线,有人找我吗?
hojiawork
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:8 积分:0 威望:0 精华:0 注册:2017/8/24 14:17:09
  发帖心情 Post By:2017/9/5 16:03:55 [只看该作者]

渣渣策略,连偷价之后还是渣渣,随便个15行以内的策略公式都比这强N倍。

 回到顶部