人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現(xiàn)在的位置:程序化交易>> 期貨公式>> 文華財經(jīng)>> 文華財經(jīng)知識>>正文內(nèi)容

請問下這個mt4公式指標可以修改成文華的代碼嗎? [贏順期貨]

  • 咨詢內(nèi)容:

    #property indicator_separate_window
    #property indicator_minimum -10
    #property indicator_maximum 100
    #property indicator_buffers 6
    #property indicator_color1 Blue
    #property indicator_color2 Red
    #property indicator_color3 Green
    #property indicator_color4 Magenta
    #property indicator_color5 DodgerBlue
    #property indicator_color6 BlueViolet

    //---- input parameters
    extern int RSIOMA          = 14;
    extern int RSIOMA_MODE     = MODE_EMA;
    extern int RSIOMA_PRICE    = PRICE_CLOSE;

    extern int Ma_RSIOMA       = 21,
               Ma_RSIOMA_MODE  = MODE_EMA;

    extern int BuyTrigger      = 80;
    extern int SellTrigger     = 20;

    extern color BuyTriggerColor  = DodgerBlue;
    extern color SellTriggerColor = Magenta;

    extern int MainTrendLong   = 50;
    extern int MainTrendShort  = 50;

    extern color MainTrendLongColor     = Red;
    extern color MainTrendShortColor    = Green;

    //---- buffers
    double RSIBuffer[];
    double PosBuffer[];
    double NegBuffer[];

    double bdn[],bup[];
    double sdn[],sup[];

    double marsioma[];
    string short_name;
    //+------------------------------------------------------------------+
    //| Custom indicator initialization function                         |
    //+------------------------------------------------------------------+
    int init()
      {
       short_name = StringConcatenate("RSIOMA(",RSIOMA,")");  
       IndicatorBuffers(8);
      
       SetIndexBuffer(0,RSIBuffer);
       SetIndexBuffer(2,bup);
       SetIndexBuffer(1,bdn);
       SetIndexBuffer(3,sdn);
       SetIndexBuffer(4,sup);
       SetIndexBuffer(5,marsioma);
      
       SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);
       SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
       SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,1);
       SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
       SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1);
       SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,1);
      
       SetIndexBuffer(6,PosBuffer);
       SetIndexBuffer(7,NegBuffer);
         
       IndicatorShortName(short_name);

       SetIndexDrawBegin(0,RSIOMA);
       SetIndexDrawBegin(1,RSIOMA);
       SetIndexDrawBegin(2,RSIOMA);
       SetIndexDrawBegin(3,RSIOMA);
       SetIndexDrawBegin(4,RSIOMA);
       SetIndexDrawBegin(5,RSIOMA);
       SetIndexDrawBegin(6,RSIOMA);
       SetIndexDrawBegin(7,RSIOMA);
    //----

     drawLine(BuyTrigger,"BuyTrigger", BuyTriggerColor);
       drawLine(SellTrigger,"SellTrigger", SellTriggerColor );
       drawLine(MainTrendLong,"MainTrendLong", MainTrendLongColor );
       drawLine(MainTrendShort,"MainTrendShort",MainTrendShortColor );

       return(0);
      }
    //+------------------------------------------------------------------+
    //| Relative Strength Index                                          |
    //+------------------------------------------------------------------+
    int start()
      {
      
     
      
       int    i,counted_bars=IndicatorCounted();
       double rel,negative,positive;
    //----
       if(Bars<=RSIOMA) return(0);
    //---- initial zero
       if(counted_bars<1)
          for(i=1;i<=RSIOMA;i++) RSIBuffer[Bars-i]=0.0;
    //----
       i=Bars-RSIOMA-1;
       int ma = i;
       if(counted_bars>=RSIOMA) i=Bars-counted_bars-1;
       while(i>=0)
         {
          double sumn=0.0,sump=0.0;
          if(i==Bars-RSIOMA-1)
            {
             int k=Bars-2;
             //---- initial accumulation
             while(k>=i)
               {
               
                double cma = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,k);
                double pma = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,k+1);
               
                rel=cma-pma;
               
                if(rel>0) sump+=rel;
                else      sumn-=rel;
                k--;
               }
             positive=sump/RSIOMA;
             negative=sumn/RSIOMA;
            }
          else
            {
             //---- smoothed moving average
             double ccma = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,i);
             double ppma = iMA(Symbol(),0,RSIOMA,0,RSIOMA_MODE,RSIOMA_PRICE,i+1);
               
             rel=ccma-ppma;
            
             if(rel>0) sump=rel;
             else      sumn=-rel;
             positive=(PosBuffer[i+1]*(RSIOMA-1)+sump)/RSIOMA;
             negative=(NegBuffer[i+1]*(RSIOMA-1)+sumn)/RSIOMA;
            }
          PosBuffer[i]=positive;
          NegBuffer[i]=negative;
          if(negative==0.0) RSIBuffer[i]=0.0;
          else
          {
              RSIBuffer[i]=100.0-100.0/(1+positive/negative);
             
              bdn[i] = 0;
              bup[i] = 0;
              sdn[i] = 0;
              sup[i] = 0;
             
              if(RSIBuffer[i]>MainTrendLong)
              bup[i] = -10;
             
              if(RSIBuffer[i]<MainTrendShort)
              bdn[i] = -10;
             
              if(RSIBuffer[i]<20 && RSIBuffer[i]>RSIBuffer[i+1])
              sup[i] = -10;
             
              if(RSIBuffer[i]>80 && RSIBuffer[i]<RSIBuffer[i+1])
              sdn[i] = -10;
               
             
          }   
          i--;
         }
        
         while(ma>=0)
         {
             marsioma[ma] = iMAOnArray(RSIBuffer,0,Ma_RSIOMA,0,Ma_RSIOMA_MODE,ma);
             ma--;
         }   
        
    //----
       return(0);
      }
    //+------------------------------------------------------------------+
    void drawLine(double lvl,string name, color Col )
    {
          
                ObjectDelete(name);
                ObjectCreate(name, OBJ_HLINE, WindowFind(short_name), Time[0], lvl,Time[0],lvl);
               
               
                ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
               
                ObjectSet(name, OBJPROP_COLOR, Col);       
                ObjectSet(name,OBJPROP_WIDTH,1);
             
          
    }

     

     



    此主題相關(guān)圖片如下:qq截圖20120706100459.jpg
    圖片點擊可在新窗口打開查看

     

  • 贏順技術(shù)人員:

    您可以將模型發(fā)在該貼中http://help.shwebstock.com.cn/dispbbs.asp?boardid=14&Id=199532,我們會及時編寫完后回復(fù)您

     

 

如果以上指標公式不適用于您常用的行情軟件

或者您想改編成選股公式,以便快速選出某種形態(tài)個股的話,

可以聯(lián)系我們相關(guān)技術(shù)人員 QQ: 262069696  點擊在線交流進行 有償 改編!

 


【字體: 】【打印文章】【查看評論

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 天天爱天天操天天射 | 在线观看嗯啊成人动作片 | 韩日一区二区 | 国产制服丝袜视频 | 福利影院在线播放 | 天天爱天天色天天干 | 日韩一区二区免费看 | 国产一二三区在线 | 久久亚洲综合色 | 老司机免费精品视频 | 成人久久久观看免费毛片 | 日本国产一区 | 欧美人与牲动交a欧美精品 欧美人与日本人xx在线视频 | 久久久久综合一本久道 | 日韩另类 | 被黄漫网站视频在线观看 | 欧美日韩美女 | 黄 色 免费网 站 成 人 | 香蕉视频网站在线 | a亚洲视频 | 亚洲欧美日韩国产精品影院 | 99激情| 午夜影院私人 | 国产色一区 | 最近韩国日本免费免费版 | 成人 在线欧美亚洲 | 欧美黄网站免费观看 | 天堂在线最新资源 | 中国大陆高清aⅴ毛片 | 激情五月开心婷婷 | 精品欧美一区二区三区 | 亚欧成人中文字幕一区 | 九九成人免费视频 | 一区二区免费播放 | 男女边摸边吃奶边做视频在线 | 国产精品日本欧美一区二区 | 精品91麻豆免费免费国产在线 | 亚洲精品高清久久 | 亚洲欧美日韩高清综合678 | 日韩不卡高清视频 | 一级毛片免费观看视频 |