Moving averages in the correct order

Hi

What is the correct code to highlight bars where three moving averages are in correct order?

eg a fast MA is above a medium MA and the medium MA is above a slow MA?

Thanks

Steve

 

Hi Steve,

Here is an example using a set of 5, 25 and 50 MA’s.

FASTMA = MA(BARS=5);
MEDMA = MA(BARS=25) ;
SLOWMA = MA(BARS=50) ;
MEDMA > SLOWMA and FASTMA > MEDMA

The shaded green section shows where the above script would show a True result.

Ex2

Thanks Matthew - I was just wondering how you got the shaded effect? I've been able to highlight the correct bars with arrows (using showbar) however I'm curious as to how you achieved the shaded zones.

 

Thanks
Steve

 

Hi Steve,

I added the script to a Show View tool, i then dragged and dropped the show view onto the chart directly and adjusted the transparency to 50%.

https://help.optuma.com/kb/faq.php?id=720