Download MetaTrader 5

Indicators: CMO v1

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
185313
MetaQuotes Software Corp.  

CMO v1:

CMO v1 indicator.

Author: John Smith

MQL4 Comments
16319
MQL4 Comments  

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