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


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

   

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


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

主题:海龟系统

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


加好友 发短信
等级:超级版主 帖子:21598 积分:0 威望:0 精华:1 注册:2010/7/31 16:35:30
海龟系统  发帖心情 Post By:2020/2/10 14:29:24 [只看该作者]

软件自带有海龟系统,不过那个写的太复杂不利于理解。后来去理思路的时候发现其实原本海龟设计没有很高深,关键就是在数量仓位上利用波动幅度atr来进行构建。

出入场条件就根据唐奇安通道的高低位,属于典型的趋势跟踪策略,在期货上前几年收益还是很惊人的,不过近几年就不甚理想。

我这里给出一个我自己整理逻辑后的模板范例

 

TRR:=MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));//真实波幅
ATR:=ref(MA(TRR,20),1); //波幅的20日均线
unit:(asset*0.01)/(MULTIPLIER*atr);

INPUT:X(20,1,100,5);
X周期高点:=REF(HHV(H,X),1);//X是参数,自行调整
X周期低点:=REF(LLV(L,X),1);

//记录建仓的atr
variable:entry=0;
//记录交易次数
variable:num=0;
//入场条件:
开多条件:=High>=X周期高点 and barpos>20;
开空条件:=Low<=X周期低点 and barpos>20;

//建立头寸
if 开多条件 and holding=0 then
begin
 buy(1,unit,marketr);
 entry:=atr;
 num:=1;
end

if 开空条件 and holding=0 then
begin
 buyshort(1,unit,marketr);
 entry:=atr;
 num:=1;
end


//每盈利0.5个atr加仓,最多加4次
if holding>0 and high>enterprice+0.5*entry and num<4 then
begin
 buy(1,unit,marketr);
 num:=num+1;
end

if holding<0 and low<enterprice-0.5*entry and num<4 then
begin
 buyshort(1,unit,marketr);
 num:=num+1;
end

//统计出场和止损的次数
variable:n1=0,n2=0;

//止损2个atr
if holding>0 and low<enterprice-2*entry and holding>0 then
begin
 sell(1,holding,marketr);
 n1:=n1+1;
end
if holding<0 and high>enterprice+2*entry and holding<0 then
begin
 sellshort(1,holding,marketr);
 n1:=n1+1;
end

//破短期高低位,平仓出场
INPUT:Y(10,1,100,5);
Y周期高点:=REF(HHV(H,10),1);
Y周期低点:=REF(LLV(L,10),1);
if low<Y周期低点 and holding>0 then
begin
 sell(1,holding,marketr);
 n2:=n2+1;
end
if high>Y周期高点 and holding<0 then
begin
 sellshort(1,holding,marketr);
 n2:=n2+1;
end


 回到顶部