High Crosses above MA

Hii,

In the attached work book i have indicated a showbar with a condition below.

HIGH() CrossesAbove MA(BARS=50)

However in the attached image below there is a bar where the high crossesabove the 50 EMA is not captured by the showbar. I think the above code only works if the previous bar high was below the 50 ema. Is there a way to write the code in optuma to use price crosses above the 50 ema in order to capture the highlighted bar rather than using OHLC.

 

Regards,

Deepak

 

 

High-Crosses-Above-50-EMA.owb (9.04 KB)

Hi Deepak,

Imagine a line joining all the highs together. You can actually do this with a 1 period moving average set to the highs.

The only time your script would fire is if the high was underneath the MA50 on the prior day. That was not the case in your example.

All the best

Mathew