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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 求助写个指标

   

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


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

主题:求助写个指标

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


加好友 发短信 原leevolvo
等级:版主 帖子:2160 积分:10563 威望:0 精华:11 注册:2010/11/3 11:21:19
  发帖心情 Post By:2011/12/1 12:56:22 [显示全部帖子]

variable:flag=0;
hi30:=ref(hhv(h,30),1);
lo30:=ref(llv(l,30),1);
diff:=ema(close,12) - ema(close,26);
dea:=ema(diff,9);
sc:=cross(dea,diff);
jc:=cross(diff,dea);
hi30_diff:=ref(hhv(diff,30),1);
lo30_diff:=ref(llv(diff,30),1);

if flag<>-1 and h>hi30 and diff<hi30_diff then begin
 flag:=-1;
 kpos:=barpos;
end

if flag<>1 and l<lo30 and diff>lo30_diff then begin
 flag:=1;
 kpos:=barpos;
end

if holding>0 and cross(dea,diff) then begin
 sell(1,1,limitr,c);
 flag:=0;
end

if holding<0 and cross(diff,dea) then begin
 sellshort(1,1,limitr,c);
 flag:=0;
end

if flag=1 and holding=0 then begin
 if barpos-kpos<=10 and jc then begin
  buy(1,1,limitr,c);
 end
 if barpos-kpos=10 then flag:=0;
end

if flag=-1 and holding=0 then begin
 if barpos-kpos<=10 and sc then begin
  buyshort(1,1,limitr,c);
 end
 if barpos-kpos=10 then flag:=0;
end

zichan:asset,noaxis;
if barpos=1 then begin
 MaxAsset:=zichan;
 hc:=0; 
end
if zichan>MaxAsset then MaxAsset:=zichan;
if MaxAsset-zichan>hc then hc:=MaxAsset-zichan;
Maxhc:hc,linethick0;
交易次数:totaltrade,linethick0;
正确率:percentwin,linethick0;

[此贴子已经被作者于2011-12-1 12:58:38编辑过]

 回到顶部