外汇论坛 外兔财经

开启左侧

大家都快来看看~~多一个人多一份力量!!!!!!!!!!!!

[复制链接]
发表于 2009-7-14 17:15 | 显示全部楼层 |阅读模式
https://www.y2cn.com
  这个composite index 复合指标 简称CMB复合指标 是我在 专业交易人士技术分析 一书中看到的 是和RSI配合使用的指标 这个复合指标背离效果非常的好 对波浪理论的 波浪研判有很大的作用 

    这张图表里的就是CMB复合指标   我在一本书里找到了这个指标的源码 希望有高手能改写成MT4能用的指标源码 造福大家 谢谢!!



  指标源码如下 (照书上扒下来的)
   
    Tradestation Format:

Create two functions in EasyLanguage first.  The first is a 9-period momentum study of RSI.  This can be written as

RSIDelta = MOMENTUM(RSI(CLOSE,14),9)

Then a smoothed short period RSI is created,

RSIsma = AVERAGE(RSI(CLOSE,3),3)

The indicator can then be created:

INDICATOR:  MY INDICATOR

Plot1(RSIDelta+RSIsma,"Plot1");

Plot2(average((plot1),13),"Plot2");

Plot3(average((plot1),33),"Plot3");




MetaStock Format:

A = RSI(14)-Ref(RSI(14),-9)+Mov(RSI(3),3,S);

Plot1 = Mov(A,13,S);

Plot2 = Mov(A,33,S);

A;Plot1;Plot2;







Here's what I've gotten so far:


#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 DodgerBlue

#property indicator_color2 Lime

#property indicator_color3 Yellow

//---- buffers

double PlotBuffer1[];

double PlotBuffer2[];

double PlotBuffer3[];




int counted_bars;










//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int init()

  {

//---- indicators

   SetIndexStyle(0,DRAW_LINE);   // Plot1

   SetIndexBuffer(0,PlotBuffer1);

   SetIndexStyle(1,DRAW_LINE);   // Plot2

   SetIndexBuffer(1,PlotBuffer2);

   SetIndexStyle(2,DRAW_LINE);   // Plot3

   SetIndexBuffer(2,PlotBuffer3);

   SetIndexDrawBegin(0,0);

   SetIndexDrawBegin(1,0);

   SetIndexDrawBegin(2,0);

   

   IndicatorShortName("MyIndicator");

   counted_bars=IndicatorCounted();

   

//----

   return(0);

  }

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function                       |

//+------------------------------------------------------------------+

int deinit()

  {

//----

//----

   return(0);

  }

//+------------------------------------------------------------------+

//| Custom indicator iteration function                              |

//+------------------------------------------------------------------+

int start()

  {

   double RSIDelta;

   double RSIsma;

   int pos = counted_bars;

//----

//   Alert("position:  " + pos);

//   Alert("current bar close:  " + Close[pos]);

//   Alert("bars:  " + Bars);

   

   RSIDelta = iMomentum(NULL,0,9,iRSI(NULL,0,14,PRICE_CLOSE,0),0);

   RSIsma = iMA(NULL,0,3,0,MODE_SMMA,iRSI(NULL,0,3,PRICE_CLOSE,0),0);

   PlotBuffer1[counted_bars] = RSIDelta+RSIsma;

   PlotBuffer2[counted_bars] = iMA(NULL,0,13,0,MODE_SMA,PlotBuffer1,0);

   PlotBuffer3[counted_bars] = iMA(NULL,0,33,0,MODE_SMA,PlotBuffer1,0);

   

   pos--;

//----

   return(0);

  }

//+------------------------------------------------------------------+
0000000000.gif
 楼主| 发表于 2009-7-15 17:36 | 显示全部楼层
难道就没有高手了吗?
发表于 2009-7-17 15:32 | 显示全部楼层
能否问下你在哪本书中看的cmb源码

本版积分规则

QQ|手机版 Mobile Version|Archiver|关于我们 About Us|联系我们 Contact Us|Y2外汇论坛 外兔财经

GMT+8, 2024-4-30 07:58 , Processed in 0.054611 second(s), 32 queries .

Powered by Discuz! X7.2

Copyright © 2001-2021, Tencent Cloud.

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