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


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

   

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


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

主题:海龟系统

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


加好友 发短信
等级:黑侠 帖子:659 积分:0 威望:0 精华:0 注册:2015/2/5 10:08:43
  发帖心情 Post By:2020/4/3 14:18:30 [显示全部帖子]

谢谢老师回复,我先试试。


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


加好友 发短信
等级:黑侠 帖子:659 积分:0 威望:0 精华:0 注册:2015/2/5 10:08:43
  发帖心情 Post By:2020/4/3 14:34:59 [显示全部帖子]

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

 

 

这个策略还是有的复杂,对股票买卖来说,我喜欢用一定资金全仓进出,想让老师改一个满仓买卖的策略,有空改一下吧,谢谢。


 回到顶部