[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 48
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
Guys, please help!
There is a variable counter. I need different actions to be performed on even and odd numbers.
I see it like this
if ((KO/2) > MathFloor(KO/2)) {body1 in which the counter change KO=KO+1;}
if ((KO/2) == MathFloor(KO/2)) {body2 in which the counter change KO=KO+1;}
but body1 is always executed.
The parity is determined by checking the remainder after division:
Guys, please help!
There is a variable counter. I need different actions to be performed on even and odd numbers.
I see it like this
if ((KO/2) > MathFloor(KO/2)) {body1 in which the counter change KO=KO+1;}
if ((KO/2) == MathFloor(KO/2)) { body2 in which the counter change KO=KO+1;}
but body1 is executed all the time.
if (MathAbs(MathMod(KO,2) == 0)) {body1 in which the KO counter change is even}
else {body1 in which the KO counter change is odd}
if KO always >=0, then MathAbs() is not required
Please advise how to align code in MQL4 under Windows 7.
Or how can someone level it?
Thank you.
Good day to all!
Could you please advise how to do the MQL4 code alignment in Windows 7?
Or who has already mastered it?
Thank you.
there is no built-in "beautyfinder" in the meta-editor, unlike other more advanced IDEs, and probably won't be
you can "align" (or do it periodically as needed) in any development environment you like (MQ4 is just a standard tessct)
Some people don't use meta-editor at all, and attach the MQL to EX4 compilation script to Notepad+, Hexedit or something else (MQL-coloring scripts for them are available, too)
A textbook on numerical methods for solving mathematical problems will help you))
e.g. http://www. uchites.ru/files/nummethod_book_chapter3-45.pdf (chapter 3.5. Numerical integration of functions)
although... maybe someone has already done this for themselves
Thanks, if no one else responds, I will have to remember my youth))))
If accuracy is not very important, you can simply use the rectangular method, i.e. by bluntly summing up the original series, you will get an approximate value of the integral.
but more details, if you don't mind, on some five, six bars...
and more details, if you don't mind, on some five, six bars...