Please advise how to solve the error 4806 - requested data not found. I want to get data of different averaging periods for bolinger from indicator. The Handle is received in OnInit, but for my purpose it should be inOnCalculate, hence the error. Help me to understand it by example.
@Vladimir Karputov@Maxim Kuznetsov Glue or nail? )) Simple task - complex preparation, in mql4 it was done in one or two. So, how do I gather the bolinger data for different timeframes and averaging periods into one array without errors?
Николай К: @Vladimir Karputov@Maxim Kuznetsov Nail it or nail it? )) Simple task - complex preparation, in mql4 was done in one two. So, how do I gather the bolinger data for different timeframes and averaging periods into one array without errors?
You got it right, you just ate all the handles, it's an exhaustible resource... you need to free them.
hdl=iMA(....)
if (hdl!=INVALID_HANDLE) {
/// do something
IndicatorRelease(hdl);
}
see how fxsaber did it in his libraries to make it easier to move from 4 to 5
Hello Artem! I am envious to see how quickly comrades in MQL5 code using CTrade and other classes, originally built in MT5. Due to various circumstances, I have to code in MQL4 and come up with my own awkward constructs. Maybe, there is such a set of classes for MQL4 already? Thanks in advance)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please advise how to solve the error 4806 - requested data not found. I want to get data of different averaging periods for bolinger from indicator. The Handle is received in OnInit, but for my purpose it should be inOnCalculate, hence the error. Help me to understand it by example.
Organised like this, sorry for the integrity.
The indicator handle in MQL5 must be created in OnInit()!
The indicator handle in MQL5 must be created in OnInit()!
Then there will be a separate handle for each averaging period?
It is organized like this, sorry for the consistency.
The resource is not freed up...but otherwise it's correct, though not efficient
after iMA(...) and operations with it, you need to call IndicatorRelease if you don't need it anymore
IndicatorRelease() function serves to release the indicator from the computer memory, to which this indicator handle is passed.
And an indicator handle can be created anywhere, except OnDeinit. Just worry about "what to do in case of creation error".
@Vladimir Karputov @Maxim Kuznetsov Nail it or nail it? )) Simple task - complex preparation, in mql4 was done in one two. So, how do I gather the bolinger data for different timeframes and averaging periods into one array without errors?
You got it right, you just ate all the handles, it's an exhaustible resource... you need to free them.
hdl=iMA(....)
if (hdl!=INVALID_HANDLE) {
/// do something
IndicatorRelease(hdl);
}
see how fxsaber did it in his libraries to make it easier to move from 4 to 5
The first thing that comes to mind is to check the operation of the indicator and then watch the EA
I can't find anything there, in the indicator there are no lines like - outputs if..., every tick is processed, and in the robot comes every tick.
The entire m1 has no signal until the bar changes and a new signal, recall the signal all ticks are watching, processing a new bar is not.
And i remind you that i have to test in 3 terminals at once. i will be buried with 3 terminals in my hand.
I can't find anything there, in the indicator there are no lines like - outputs if..., every tick is processed, and in the robot comes every tick.
The entire m1 has no signal until the bar changes and a new signal, recall the signal all ticks are watching, processing a new bar is not.
The robot has no signal in all aspects of the robot.
Perhaps in the indicator the signal only when the bar changes...
Better to see the code of course.
I am envious to see how quickly comrades in MQL5 code using CTrade and other classes, originally built in MT5.
Due to various circumstances, I have to code in MQL4 and come up with my own awkward constructs.
Maybe, there is such a set of classes for MQL4 already?
Thanks in advance)