This simple code is just to understand how work methods with panel... the "r" not increment if it's stay inside OnCalculate() method... If you put the OnCalculate code inside
OnStart()
OnTick()
Start()
But inside OnCalculate it doesnt increase his value...this is the problem...I hope I have been clearer now
This simple code is just to understand how work methods with panel... the "r" not increment if it's stay inside OnCalculate() method... If you put the OnCalculate code inside
OnStart()
OnTick()
Start()
But inside OnCalculate it doesnt increase his value...this is the problem...I hope I have been clearer now
How should r increment? Bcs its nice weather outside?
you can only increment in a loop
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[])
I have never used this form of OnCalculate().
As far as I am aware, it is not even available for MQL4, only MQL5.
Try using the standard OnCalculate().
Amando... what you mean how should r increment????...the line
r++;
inside OnCalculate....
Thanks Keith your answer is the cure... I wrong the OnCalculate call, changing this:
int OnCalculate(const int rates_total, const int prev_calculated, const int begin, const double &price[])
with this:
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) {
Everything works fine.
The weird stuff is that I simple modified an example inside MT4 standard... and the OnCalculate function is in this way...
Thanks a lot
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everyone
I'm creating a panel for an indicator, the problem is the methods I can use. Until now when
I make indi i use:
- OnInit to initialize;
- OnCalculate to catch the tick movement;
- OnChartEvent to catch the mouse interactions;
- OnDeinit to destroy all at the end;
For Ea OnTick instead OnCalculate,
For Script OnStart instead OnCalculate.
Everything works like a charm... the problem now using Panel, is that OnCalculate dont work
So now I'm a little bit confused.... what method I can use instead OnCalculate????
OnStart??
Star???
OnTick???
Here the complite code, it's only the simple panel inside MT4 library