Alert about how many candles ago price crossed MA
-
Hello,
I would like to get information about how many candles ago price crossed MA, I created EA for that, but unfortunately it doesn't work. What is wrong there, link to shared project is here https://fxdreema.com/shared/RANrLu32c?
Thanks a lot!
-
@mmaarits Your conditions dont make sense, that first condition says price is already above the MA and the next condition says when price crosses above. It cant cross above if it is ALREADY above the MA
-
@mmaarits said in Alert about how many candles ago price crossed MA:
Hello,
I would like to get information about how many candles ago price crossed MA, I created EA for that, but unfortunately it doesn't work. What is wrong there, link to shared project is here https://fxdreema.com/shared/RANrLu32c?
Thanks a lot!
Yea, delete the first condition.
-
Thank you very much for your help! I made this change, but unfortunately it still doesn't work as expected.
The initial idea was to implement following logic:
If price is above MA, check when it crossed above MA and alert
If price is below MA, check when it crossed below MA and alert -
then any time after it crosses, you will be alerted every new candle...theoretically.
But the way you are doing it is illogical.
If you are above it, then it doesnt matter when it crossed it, unless you need that information to use later. You would then do a variable system...
If price X MA, modify variable "MAX"
If price is above MA, check MAX...
But I dont understand why you would need to know...what you would need to know. The price at that moment? Thats what that variable will produce. If you are trying to seek a candle ID thats a bit more complicated and you will need a loop.
It would probably be easier if you marked a chart and showed us what a perfect trade looks like, and then share a link of your current project attempt to make that happen.
-
Thank you very much for your help! I created a screenshot to explain what I am searching for, the red indicator is 25SMA and I want to get as an alert how many candles ago the price crossed 25SMA. So, I want to get alert about the number that is marked as yellow.
