High and Low MA inicator

Lilawhit29

Trader
Aug 7, 2015
9
1
9
I need an indicator for my strategy as follows: Example 20 moving average.

Arrow indicating Buy signal when current bar closes above 20 ma high.
Arrow indicating Sell signal when current bar closes below 20 ma low.

Must happen alternatively i.e buy signal then sell signal when first candles closes either above or below Ma high or Ma low.

May sound simple to some people but i am not a programmer
 
Ok so I found this but would like to modify it so that an arrow alert appears when the first bar closes above the MA high and then an arrow alert when the first bar closes below the MA low, alternating each time.

Is this possible? help much appreciated.
 

Attached File(s)

Yes. Spot on, Exactly what I was looking for. ... Thank you.

Would it be possible to add to the code a simple buy option when the Blue up arrow appears at candle close and a sell option when the Red down arrow appears? Nothing fancy just a simple buy or sell.
 
Looking over where I could 'strengthen' the indicator so the signals are more valid and I believe adding PSAR to this indicator may improve it.

i.e arrows only appear when Bar closes above HIGH or below LOW ... AND the first dot of PSAR changes direction.

Would this be too difficult to add into the code I wonder.
 
Yes. Spot on, Exactly what I was looking for. ... Thank you.

Would it be possible to add to the code a simple buy option when the Blue up arrow appears at candle close and a sell option when the Red down arrow appears? Nothing fancy just a simple buy or sell.
You would need an expert advisor for that, not an indicator.
 
I have been researching expert advisors and indicators and it states that every .mq4 file also has an .ex4 file, which I can see. HOWEVER, when I move the EA file to the expert folder, and restart MT4 nothing happens.

I have tried this with other indicators and their ea files and it is the same, nothing happens.
 
I have been researching expert advisors and indicators and it states that every .mq4 file also has an .ex4 file, which I can see. HOWEVER, when I move the EA file to the expert folder, and restart MT4 nothing happens.

I have tried this with other indicators and their ea files and it is the same, nothing happens.
.ex4 file is just a compiled form of .mq4 file. It is not necessarily an EA. An EA is coded differently - you cannot just copy .mq4 file from Indicators folder to Experts to make an EA out of an indicator.

As I have said earlier, you can easily make your EA via MQL Wizard. You do not even need to know how to code for that.

PS: EA discussion is off-topic in this indicator thread. There is a separate subforum (MetaTrader Expert Advisors) for such discussions.