No free help
Or pay someone. Top of every page is the link Freelance.
Hiring to write script
- General - MQL5 programming forum
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
No free help
Or pay someone. Top of every page is the link Freelance.
Hiring to write
script - General - MQL5 programming forum
Hey,
I want to count the number of bars it has been since the last MA crossover. Example chart below, which would have the answer of 12 bars including the current bar.
is there anybody help me ?
You can use the following algorithm:
in the "header" of the adviser we set up a variable in which we store the opening time of the bar at which the intersection is detected. Then (when searching for a signal) we use the CopyBuffer function - option 3 ' Call by the start and end dates of a required time interval'
int CopyBuffer ( int indicator_handle, // indicator handle int buffer_num, // indicator buffer number datetime start_time, // start date and time datetime stop_time, // end date and time double buffer[] // target array to copy );
We make a tour (in a loop) of the copied values and check if there is a new intersection? If there is a new intersection, we write the time the bar opens in the variable.

- www.mql5.com
Hey,
I want to count the number of bars it has been since the last MA crossover. Example chart below, which would have the answer of 12 bars including the current bar.
is there anybody help me ?
Today I will post training material: how to calculate the number of bars after the last crossing.

- 2020.04.09
- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey,
I want to count the number of bars it has been since the last MA crossover. Example chart below, which would have the answer of 12 bars including the current bar.
is there anybody help me ?