Errors, bugs, questions - page 3146
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
There's something not clear in the tester
I ask for 1 month's history, it loads for "100" years.
Why?
There's something not clear in the tester
I ask for 1 month's history, it loads for "100" years.
What for?
Not a hundred years, just 1 year.
You should always leave the available space before the requested interval for the indicators to calculate correctly, and not to start from zero.
And so that newcomers don't ask questions about missing this or that data.
Record the last and penultimate asc and bid and count the difference.
Not a hundred years, but just 1 year.
You should always leave space available before the requested interval, so that indicators are calculated correctly, rather than starting from scratch.
And so that newcomers do not ask questions about the lack of certain data.
How do you " leave space before the requested interval" ? I'm doing Expert Advisor test, that uses custom indicator from 2021, in the real EA this indicator is plotted correctly in this timeframe, but in the test it looks like it's starting from zero and therefore the results are incorrect...
This I understand. Consistency is important to me. So far my thoughts are as follows: since it is a position, we should address it. For this, we start looping through all positions, then we get its ticket and then the time of position opening. Declare array with ticks MqlTick ticks[ ]. Counting some time from the position opening time, write ticks into the tick array through CopyTickRange. Then apply ArraySetAsSeries to the tick array, if possible. And apply the difference between the last and the last but one bid and ask, which you've described, to the last two ticks of that array. But so far this is just a thought, maybe someone has already done this and has an example. Respectfully.
For MT4 it is simple. There, the order opening is tied to a tick, the user does not see how the position is filled. But in 5 it does. He or she sees trades when the position is filled. And a position can be filled more than one tick. This is an example. But the logic is correct. Although, for me, it is more correct to do it based on hot pursuit. After the triggering of a pending order or a market order, at the moment of obtaining an answer on the position with the order ticket, obtain data about price and time of the opening and look for the nearest tick by price and time. The problem is that the response may only come on the next tick or after a tick. There is no guarantee.
Not a hundred years, but just 1 year.
You should always leave space available before the requested interval, so that indicators are calculated correctly, rather than starting from scratch.
And so that newcomers do not ask questions about the lack of certain data.
If you could specify in indicators something like #property indicator_bars_need it would be just fabulously convenient.
and the tester would simply take the biggest value, if this parameter is present in several indicators.
There is an opposite situation when one needs as much history as possible, one year is not enough. That is why my last client was surprised why the tester collected so few historical extrema (according to the indicator algorithm).
If you could specify something like #property indicator_bars_need in indicators, it would be really great.
and the tester would just take the highest value, if this parameter is present in several indicators.
Property can't adjust to the parameters. It's not fabulous anymore )
Property can't adjust to the parameters. That's not fabulous anymore ) )
))
The point of my proposal is to allow to indicate how much history is required in the indicator for the calculations.
how to" leave a space before the requested timeframe" ? I'm testing an Expert Advisor that uses a custom indicator from 2021 , the real indicator is drawn correctly for this timeframe, but in the test it looks like it starts from scratch and therefore its results are not correct .