Chaikin Money Flow Index

 

Can somebody review my first custom indicator code for Chaikin Money Flow. I just want to make sure there are no errors. If there is a simpler way to construct this indicator, please let me know. In my code, I wanted to avoid building an array of Accumulation/Distribution volumes for each bar and then doing summation over Periods on this array. I think it would have been slower than my code, in which I add the A/D volume of each new bar and subtract the A/D volume Periods ago. Thanks in advance:

#property indicator_separate_window

#property indicator_buffers 1

#property indicator_color1 Red

//Input parameters

extern int Periods=20;

//Indicator buffers

double CMF[];

double dN[];

int init()

{

IndicatorBuffers(2);

SetIndexBuffer(1,dN);

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,CMF);

IndicatorShortName( "CMF(" + Periods + ")" );

return(0);

}

int deinit()

{

return(0);

}

int start()

{

int counted_bars=IndicatorCounted();

int i=(Bars-counted_bars-1)+(Periods-1);

double dN_Sum=0.0;

double Volume_Sum=0.0;

while(i>=0)

{

double h=High;

double l=Low;

double o=Open;

double c=Close;

if (h==l) dN=0;

else dN=100*Volume*((c-l)-(h-c))/(h-l);

dN_Sum+=dN;

Volume_Sum+=Volume;

if (i<=Bars-counted_bars-1)

{

CMF=dN_Sum/Volume_Sum;

dN_Sum-=dN;

Volume_Sum-=Volume;

}

i--;

}

return(0);

}

 

I found formula of this indicator here:

http://www.linnsoft.com/tour/techind/cmf.htm

And I've developed CMF according this formula.

Try to compare 2 version of CMF.

Files:
cmf_v1.mq4  2 kb
 
igorad:
I found formula of this indicator here:

Investor/RT Tour - Chaikin Money Flow

And I've developed CMF according this formula.

Try to compare 2 version of CMF.

This is not per the formula ijn the above posted link.

The posted page describes and shows a histogram that is colored. For increasing values and decreasing values. Regardless of weather its on top of the center line, or under.

I changed to histogram but don't have the same color reaction to price as in the above posted link.

I wish I understood what makes this so. I would make the changes but I am not quite getting it. I take it you didn't either, so you went the easy way.

It says best period is 21 and you have it set at default 20?

I just wonder what other parts of the code you decided to make small changes too.

Its this kind of work that makes a system appear to be no good.

When you make small changes like this, don't be surprised if your results are not accurate or what you expected.

Who knows how many people are trying to use this indicator, thinking there following the same indicator as on the above posted link. Poor souls who don't recognize this kind of details.

This is why the Turtle traders said "if you posted there proven system on a bill board for all to see, 95% would still fail", because they'd employ there own personal tweaks to it. Then wonder why it don't work.

Don't make these changes for me. I don't need or use it. I just saw this posted to another group.This little rant was for the greater good. I hope.

Dave

 

so, any1 here have the correct version of CMF?

 

These two indicators are completely different....which one is correct??

Can someone please post a known working version of Chaikin's Money Flow Index?

Thanks!

 

Hey, does anybody know the formula for the regular Chaikin indicator, not the Oscillator and not the Flow Index?

 

need help with downloading cmf

I just don't understand this site.Everytime I try to download the mq4 file for chaikins money flow i'm ask to log in.

Then I do and it ask the same again, and again and again.I have scoured the internet searching many hours for this file and although I saw dozens of indicators in mq4 format the one I need continues to elude me.

I need this file to back test my system and now that i found the file in mq4 format I can't download the bluddy thing ,a little like window shopping.

if you can e-mail this file for me or explain how I can get past that irritating login page I would appreciate it.

chrst_heunes@yahoo.com

 

Hi christiaan,

when you opn this page Forex Forum | Forex Tsd | Metatrader Forum so you have 2 places to login.

Log on the top place.

Indicator is on this post: https://www.mql5.com/en/forum/general

 

does not work

I am logged in.In the top right corner it says welcome christiaan then I try to download file and it directs me to the login page and I log in the top right corner.

Then it says thank you for logging in and it auotomatically redirect me to the login page.I can post but I still can;t get my hands on that file

help me?

 

I think I have it

I think I have it.After many many hours and hundrends of indicators most of which I have never heard of I finally have the file I need.Now I can backtest my strategy and save months.

Thank you

 

Cmf

Added option to use histo or line, also smoothed with T3, so still not as per formula in above posted link. . Need to have the original CMF_v1 in indicators folder.

Reason: