Download MetaTrader 5

Indicators: CMO v1

To add comments, please log in or register
Code Base will help you in mastering your theoretical skills. Come and learn!
MetaQuotes Software Corp.
Moderator
181377
MetaQuotes Software Corp. 2008.03.01 08:10 

CMO v1:

CMO v1 indicator.

Author: John Smith

MQL4 Comments
16319
MQL4 Comments 2012.10.27 13:35  

I fixed tis indicator so that it works right away. Before it was gettig a divide by zero error and not showing the indicator when you load it.

near the end of the program is the line: 

  CMO[shift]=(SumBulls-SumBears)/(SumBulls+SumBears)*100;

replace this with:

      if(SumBulls+SumBears != 0)
      {
      CMO[shift]=(SumBulls-SumBears)/(SumBulls+SumBears)*100;
      }
      else
      {
      CMO[shift]= 0;
      }

   

To add comments, please log in or register