Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 136
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
No it won't, with every new tick the value of Flag will be true . https://book.mql4.com/ru/variables/types
You can either declare the variable globally, at the beginning of the program for example, outside of all functions.
Or make the variable static - static bool flag=true; .
Thank you very much! And if we compare the opening and closing prices of each of the three bars, will the code change that much?
To clarify the problem. We need to compare the opening and closing of the same bar, i.e. whether bar number n is bearish or bullish. Throw the script below on the quotation window.
To insert the code correctly here, click SRC and then the code there.
Throw this EA on the quote window.
I threw it in the window, like the indicator just writes the shift value as I understand it, but what should I add to the code so that I can add how many levels I need in the settings?
I put it in the window, like the indicator just writes the shift value as I understand it, but what should I add to the code to be able to add to the settings how many levels I need?
It does not write a shift value. If memory serves me correctly, the code doesn't specify a shift, it just reads the value of the MAHA. So it outputs this value.
In order to see the shift value relative to the MA value, you need to set this value in external parameters and then output the MA value + shift value*Point for an upward shift and the MA value - shift value*Point for a downward shift.
I threw it in the window, just like the indicator just writes the shift value as I understand it, but what should I add to the code so that I can add as many levels as I need in the settings?
No, it's not. You need a shift up and down the MA by a given number of points. Not a bar shift in history.
No, it's not. You need a shift up and down the MA by a given number of points. Not a bar shift in history.
And then he will also need to make the output of messages not by comments, but by objects, and in a bigger way...
A person will never learn to think in such a way.