设为首页收藏本站

指标编写学习论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 2006|回复: 0
打印 上一主题 下一主题

这公式无法适用于指数怎么改?

[复制链接]

4397

主题

4514

帖子

24万

积分

管理员

微信号zuozhanba,QQ712997893

Rank: 9Rank: 9Rank: 9

积分
243584
跳转到指定楼层
楼主
发表于 2016-5-7 12:29:20 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
hsl:=if(capital=0,VOL/sum(VOL,100),VOL/capital);{换手率}
     if capital=0 then begin
     hsl:=VOL/sum(VOL,100);
     a:=setlbound(hsl,1);
     for i=1 to min(100-1,datacount) do hsl:=0;
    end;
     ljhs3[1]:=hsl[1];
     cyc3[1]:=mid[1];
     dd:=mid[1]*(barpos<100);
     for i=lbound(hsl)+1 to datacount do begin
        ljhs3:=ljhs3[i-1]*(1-hsl)*(34-1)/34+hsl;
        cyc3mid*hsl+cyc3[i-1]*ljhs3[i-1]*(1-hsl)*(34-1)/34)/ljhs3+dd;
     end;
正确答案:
       可以这样代入原公式
       mid:=( "1a0001$open"+"1a0001$CLOSE")/2; {均价}
       vola:= "1a0001$vol";
       VOL - - - >vola
         但是指数无capital值,所这公式无法适用于指数
正确答案:
         这样或许好些
        mid:=(o+C)/2; {均价}
        t:=if(BARPOS<100,BARPOS,100);
        hsl:=if(capital=0,V/sum(V,t),V/capital);{换手率}
           if capital=0 then begin
           hsl:=V/sum(V,t);
           for i=1 to min(100-1,SYSPARAM(3)) do hsl:=0;
         end;
         ljhs3[1]:=hsl[1];
         cyc3[1]:=mid[1];
         dd:=mid[1]*(barpos<2);
         for i=2 to datacount do begin
           ljhs3:=ljhs3[i-1]*(1-hsl)*(34-1)/34+hsl;
           cyc3mid*hsl+cyc3[i-1]*ljhs3[i-1]*(1-hsl)*(34-1)/34)/ljhs3+d;
         end;

         另建公式
         STKINDI('1A0001','cyc.cyc3',0,6);

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
购买股票池请咨询微信号zuozhanba,QQ712997893!股票池体验QQ群342994005
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

 
 
在线客服
指标交流群:
理想论坛金钻指标股票
指标团购群:
做站吧指标团购群
微信扫一扫加好友

QQ|Archiver|手机版|小黑屋|指标编写学习论坛 ( 粤ICP备14021653号-5   

GMT+8, 2024-5-3 05:08 , Processed in 0.173295 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表