📅 财经日历 📊 实时波动 📈 大盘云图 📶 行情走势 🆚 投机情绪 🚀 今日热点

    申请版主写个dtosc指标

    2011-11-07 · 4984 阅读
    下面是Dynamic Trader里面DTosc的源码:
      //+------------------------------------------------------------------+
      //+------------------------------------------------------------------+
      #property copyright \"\"
      
      #property indicator_separate_window
      #property indicator_buffers 2
      #property indicator_minimum 0
      #property indicator_maximum 100
      #property indicator_color1 Red
      #property indicator_color2 LimeGreen
      #property indicator_width1 1
      #property indicator_style1 0
      #property indicator_width2 1
      #property indicator_style2 2
      #property indicator_level1 20
      #property indicator_level2 50
      #property indicator_level3 80
      //
      //
      //
      //
      //
      
         extern int PeriodRSI  =13;
         extern int PeriodStoch= 8;
         extern int PeriodSK   = 5;
         extern int PeriodSD   = 3;
               //    0 = SMA
               //    1 - EMA
               //    2 - SMMA
               //    3 - LWMA
         extern int MAMode=1;
      
      //
      //
      //
      //
      //
      
      double SK[];
      double SD[];
      double StoRSI[];
      double RSI[];
      
      //+------------------------------------------------------------------+
      //|                                                                  |
      //+------------------------------------------------------------------+
      int init()
      {
         IndicatorBuffers(4);
            SetIndexBuffer(0,SK);
            SetIndexBuffer(1,SD);
            SetIndexBuffer(2,StoRSI);
            SetIndexBuffer(3,RSI);
         IndicatorShortName(\"DTOSC (\"+PeriodRSI+\",\"+PeriodStoch+\",\"+PeriodSK+\",\"+PeriodSD+\")\");
      return(0);
      }
      int deinit() { return(0); }
      
      //+------------------------------------------------------------------+
      //|                                                                  |
      //+------------------------------------------------------------------+
      int start()
      {
         int i,limit;
         int counted_bars = IndicatorCounted();
      
         if(counted_bars < 0) return(-1);
         if(counted_bars > 0) counted_bars--;
                   limit=Bars-counted_bars;
      
         //
         //
         //
         //
         //
                   
         for(i=limit; i>=0; i--)
         {
            RSI = iRSI(NULL,0,PeriodRSI,PRICE_WEIGHTED,i);
            double LLV = RSI[ArrayMinimum(RSI,PeriodStoch,i)];
            double HHV = RSI[ArrayMaximum(RSI,PeriodStoch,i)];
            if ((HHV-LLV)!=0)
                  StoRSI = 100.0*((RSI - LLV)/(HHV - LLV));
            else  StoRSI = 0;
         }   
         for(i=limit; i>=0; i--) SK=iMAOnArray(StoRSI,0,PeriodSK,0,MAMode,i);
         for(i=limit; i>=0; i--) SD=iMAOnArray(    SK,0,PeriodSD,0,MAMode,i);
         return(0);
      }
    ""
    还没有人打赏,支持一下
    回复

    举报

     

    回答|共 16 个

    anbuimn LV5

    发表于 2012-11-25 16:59:05 | 显示全部楼层

    i love you

    yangsluo LV7

    发表于 2012-11-25 16:59:05 | 显示全部楼层

    请发一个试试,谢谢!RongYuanQiong@163.com 。。。  

    fxopen LV4

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    先看看怎么样!  

    angel LV4

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    想了解加下Q吧  绝对真实 OK   

    重庆痞子 LV4

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    呵呵,找个机会...  

    nothing LV4

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    楼主有没有好的EA推荐  

    心魔 LV17

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    不看白不看,看也不白看  

    怨女 LV6

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    这个站不错!!  

    月芽儿 LV4

    发表于 2012-11-25 18:07:25 | 显示全部楼层

    希望大家都有好运  
    12下一页
    您需要登录后才可以回帖 登录 | 注册

    提醒: 禁止引战、谩骂、灌水内容

    微信二维码

    有问题联系客服