
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Example: Alert Crossing Two MA
this one.
this one.
Okay. I propose to take the Alert Crossing Two MA code as a basis and gradually (step by step) make changes. Add a third Moving Average ('MA Medium'). We will also have three indicator buffers ('Fast', 'Medium', 'Slow').
You also need to add indicator buffers of the 'Arrow' - 'Up' and 'Down' type.
I like to create a blank using the 'MQL5 Wizard':
Got this setup:
Preparation after making changes:
version "1.002" - almost ready indicator: all three indicators are created and drawn on the chart.
It remains to clarify in which cases to put 'Arrow UP' and 'Arrow DOWN'
version "1.002" - almost ready indicator: all three indicators are created and drawn on the chart.
It remains to clarify in which cases to put 'Arrow UP' and 'Arrow DOWN'
when fast ma crosses from above to below the middle ma, place a down arrow. opoosite for up.
EDIT: i am following along fine so far, mine just wasnt drawing the arrows on the historical/closed candles.
EDIT2: When arrow draws on open candle, the arrow should stick. Even if the ma line rebounds on wrong side of other ma, the arrow should stay.
version 1.004
New:
version 1.004
New:
yep. i understand that. thanks for mentioning it, because now i know i wasnt going craazy :)
yep. i understand that. thanks for mentioning it, because now i know i wasnt going craazy :)
Today I will finish the code for group "Alerts"...
version "1.005"
Check, please. If everything is in order - I will publish this code in CodeBase.
version "1.005"
Check, please. If everything is in order - I will publish this code in CodeBase.
ok. next msg wil be, yes it works, or not :)
version "1.005"
Check, please. If everything is in order - I will publish this code in CodeBase.
fast test, but have proven all things working as asked for:
arrows are right direction as requested. they are painted on closed and historic candles when first initialised, and they are not flickering when price is going up and down or when the fast ma moves back and forth, under and over the slower ma.
Only possible issue i am going to investigate, is when i get an alert i hear the alert.wav, but there's a "buzz" at the beginning, as if it is playing the sound at same times as displaying the alert. am going to investigate that now. Maybe you have the sound and the alert being displayed at same time, if so, i am sure i can fix that myself.
EDIT: yep, i was correct. when the sound setting has a filename and alert setting is true, the indicator does both: displays the alert window, with the sound, but also plays the sound. This gives a "buzz" when each alert and sound is played. But i can fix that easy.