MACD with 1-period SMA & 5-period SMA

 
Hello,

Is it possible to customize an MACD so it has a 1-period SMA and a 5-period SMA on top of the MACD histogram curve? When the SMAs cross this can be a useful signal, any help much appreciated and many thanks for your time.
 
I've managed to display this on a chart no problem, but I still have no idea how I can actually code MA crosses on an MACD as an EA. The logic I need is:

"If 1-period MA crosses 5-period MA on the MACD, then ...."

Hoe can I code this?

Many thanks.
 
Well, in case of cross up, before, it was below, now, it is above
Turn that into bars and prices.
 
Thanks for the feedback, I've got no problem with doing this normally, for example with price crossing an SMA, my question is how can I do this with indicators not attached to the price, but attached to other indicators?

I'm referring to this article:
"MQL4: Secrets of the MetaTrader 4 Client Terminal: Indicators"
and this section:
"How to Attach to a Subwindow Indicators that Are Opened in the Main Window by Default"

I can attach indicators to indicators fine - I'm just not sure how I can actually code them, for example how I code the crossover of a 1-SMA over a 5-SMA - with the SMAs being attached to an MACD not the price.

Thanks,
Jeremy
 
I'm no longer sure what your question is
Reason: