Help with Calculating Number of Bars between Two EMA Crossover point and Ask Price touching the Slow EMA.
The problem is well stated and it is a major one. What about you have already done as a code
ArraySetAsSeries(time, true); datetime currentTime = TimeCurrent(); datetime barOpenTime = time[0]; static int count; // make a bool variable called "crossover" turn true when you find the crossover if(crossover && (currentTime - barOpenTime == PeriodSeconds())){ count += 1; //continues to count new bars after the crossover }
Niyoshaka Stanley Lameck:
To be honest, it’s not very clear what you are talking about. Take a screenshot and mark on it the bars whose number you want to count.
That is, this is basically understandable:
Niyoshaka Stanley Lameck:
from when FAST EMA crosses SLOW EMA
from when FAST EMA crosses SLOW EMA
But the following is not clear:
Niyoshaka Stanley Lameck:
when the Ask Prices retraces back and touches on or below SLOW EMA
when the Ask Prices retraces back and touches on or below SLOW EMA
Also, trying to retrieve EMA cross over time. When I run the tester on historical data, i get a message saying "Wrong datetime" Where am I getting it wrong?
Please assist
hello, i purchased a robot and i am failing to upload it in to my experts advisors folder in my trading app. please i need help.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Dear
Good day
I am learning to code EA for two timeframe EMA trading strategy. I need to count/calculate the number of bars from when FAST EMA crosses SLOW EMA and when the Ask Prices retraces back and touches on or below SLOW EMA. I need to record this number as well as be able to get the Highest price between these two point. But I need to continue counting the bars until when the trend reverses.
Anyone who can help how to accomplish this please.
Regards