Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 771

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
Just not the calendar ones. 30 day bars backwards (Sundays, Saturdays)
Judging by the function without the shift parameter you are doing in 5 and you asked the question in 4 :)
Yes, 30 bars is 21 working days if you count from yesterday. (24.02.2019 - 25.01.2019)
I got
For the Month average candle size : 598
For a Week average candle size : 519
And iATR() gives out ten digit numbers...
So I don't understand how to use it yet.
And iATR() outputs ten-digit numbers...
Usually, decimal fractions (i.e. like the price. To convert to points you need to divide by _Point).
See illustration: euro/dollar as of today - 560 pips on a daily basis for the month.
Usually, decimal fractions (i.e. like the price. To convert to points, divide by _Point).
See the illustration: euro/dollar as of today - 560 pips on daily basis for a month.
I checked it in MQL4:
Usually, decimal fractions (i.e. like the price. To convert to points, divide by _Point).
See illustration: euro/dollar as of today - 560 pips on daily basis for a month.
I checked it in MQL5. I wrote the following code to check it:
This is what it shows:
I.e., it shows one value, but displays a different one...
Checked it in MQL5. Wrote this code to check it:
This is what it outputs:
I.e. it shows one value, but shows a different one...
In MQL5 such a construction of working with the indicator is not suitable
First you have to create a handle, and you've done it, and only after that you can get values fromthe CopyBuffer
In MQL5 such a construction of working with the indicator is not suitable
First you have to create a handle, and that's what you've done now, and after that you can get values fromthe CopyBuffer
Thanks, I will take it into account and rewrite the code.
I am just writing it in MT4 and using #include <MT4Orders.mqh> to test it in MT5.
Maybe the library doesn't support Indicators.
Thanks, I will take it into account and rewrite the code.
I just write it in MT4 and use #include <MT4Orders.mqh> to test it in MT5.
Maybe the library does not support Indicators.
Yes, only trade functions.
Thanks, I will take it into account and rewrite the code.
I just write it in MT4 and use #include <MT4Orders.mqh> to test it in MT5.
Perhaps the library does not support Indicators.
It is a very fast way to combine two platforms, it works, but it's better not to do so in mql5
And apply the indicator in the same way as in mql4
This is a very fast option to combine the two platforms, it works, but it is better not to do so in mql5
And apply the indicator in the same way as in mql4
Thank you very much for the code.
It has worked:
Now I have averaged data at the beginning of the EA start. And this data is recalculated each time I access the function.
As I understand it, in order to limit calling, I need to make a buffer record with the calculated data.
So, we need to set the condition for recalculation. On "Mondays" and if there is nothing in the buffer.
I.e. declare variable buferStep = -1; and inOnTick() if buferStep <0 or "Monday" then recalculate.
Here again I'm stuck, how can the Robot declare that today is "Monday" ?
Thank you very much for the code.
It worked out like this:
I now have the averaged data at the start of the EA. And this data is recalculated each time the function is called.
As I understand it, in order to limit calling, I need to make a buffer record with the calculated data.
So, we need to set the condition for recalculation. On "Mondays" and if there is nothing in the buffer.
I.e. declare variable buferStep = -1; and inOnTick() if buferStep <0 or "Monday" then recalculate.
Here again I have a hitch, how can Robot declare that today is "Monday" ?
I don't want to use Monday, I just want number of days ago. And I would get it on every new bar so as not to load load the Expert Advisor with calculations on every tick.