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
ArrayInitialize does not work code is attached, if we uncomment the loop, everything is fine.
And when declaring variables in class and indicator on global level with the same name - warning pops up.
Over the weekend, while there were no ticks, I debugged the indicator on demo accounts, running it on the last build of two instances of MT5 terminal, but from different companies: MetaQuotes and EGlobal. Settings are the same everywhere. To be sure I checked it off-line, so the tick factor is excluded.
The problem is that the simplest code of the "underindicator" (not to mention the full-fledged and more complex indicator) displays a different number of results in different terminals of different companies:
1. EGlobal. 2. MetaQuotes.
I completely unloaded both terminals (checked with Task Manager by memory processes), loaded them again and recompiled both codes just in case. In the end - no changes.
MathRound() works differently in 4 and 5, and should be the same.
4p's code:
5-sec code:
MathRound() works differently in 4 and 5, and should be the same.
4-sec code:
5-sec code:
The problem is here:
This value is rounded differently in 4 and 5.
No surprise there, that's the way it should be.
Why does MT5 not save order history, etc., if testing is interrupted? In MT4 it was saved.
Also there is no positioning in the order history from the testing chart - it was convenient to view orders in the area of large drawdowns by clicking on the chart.
Good evening.
Can you explain me please, how SLeep() method works?
It should pause the Expert Advisor for a certain period of time, or am I wrong?
{for (int sleep=0;sleep<10000;sleep++)
if(BarsCalculated(Handle)>=o_bars_reoptimizate)
{ Print(BarsCalculated(Handle)); break; } else Sleep(100);}
For this code, I expect the result - if the number of bars calculated for a certain indicator is greater than a certain value, the loop is broken; otherwise there is a 100ms delay in further code execution. Total possible total delay is 100*10000ms....That's enough time for calculation of indicator. Then why code continues to run? (which follows this cycle) Or in the tester, this function does not work as I assume. Thanks in advance for the clarification.
Good evening.
Can you explain me please, how SLeep() method works?
It should pause the Expert Advisor for a certain period of time, or am I wrong?
{for (int sleep=0;sleep<10000;sleep++)
if (BarsCalculated(Handle)>=o_bars_reoptimizate)
{ Print(BarsCalculated(Handle)); break; } else Sleep(100);}
For this code, I expect the result - if the number of bars calculated for a certain indicator is greater than a certain value, the loop is broken; otherwise there is a 100ms delay in further code execution. Total possible total delay is 100*10000ms....That's enough time for calculation of indicator. Then why code continues to run? (which follows this cycle) Or in the tester, this function does not work as I assume. Thanks in advance for the clarification.
The documentation, for example, CopyBuffer, causes brain rattling: "If you want to make a partial copying of indicator values into another array (not the indicator buffer), you should use the intermediate array for this purpose, in which the required values are copied. And already from this intermediate array perform element-by-element copying of the required number of values to the right places of the receiving array. "
Ifbuffer_num is explicitly referred to, the necessity of preliminary binding of the receiving array to the indicator buffer with one or another sequence number through SetIndexBuffer is certainly implied. But,"if we want to copy some values of the indicator to another array (not the indicator buffer)", we can't talk aboutbuffer_num, since it's not indicator and we, by definition, haven't connected it with anything.
A contradiction?
Ambiguity?
Or maybe I'm completely programmed?
I tried to find a clear definition of an indicator buffer and failed. Is it really any buffer linked via SetIndexBuffer or it is not enough and it should be an array with the INDICATOR_DATA identifier ?