however as soon as a new bar is formed the indicator freezes leaving me with this
Any error message(s) in the Experts tab?
None whatsoever
None whatsoever
Well, I don't see anything immediately obvious that would cause it to freeze without an error message.
Double check that objectSetBlank() and objectSetGraph() aren't creating new objects every time. MT5 really starts to bog down on me when I have a few hundred thousands graphical objects on a chart.
Also . . . try moving the call to UpdateBarGraph() out of OnCalculate(). Updating every second in OnTimer() might be enough to be useful, and maybe that's where the freeze happens.
Updating every second in OnTimer() might be enough to be useful, and maybe that's where the freeze happens.
Will do that as it's what I do on other version.
But to me, it doesn't explain why I no longer get the buffer values???
Is this an mq5 file?
MT4 cannot calculate with this method.
int start_index=prev_calculated; if(prev_calculated>0) start_index--; for(int i=start_index;i<rates_total;i++) {
Is this an mq5 file?
MT4 cannot calculate with this method.
It is mq4
int limit; if (prev_calculated == 0) limit = rates_total - Delta; else limit = rates_total - prev_calculated + 1; for (int i = limit; i >= 0; i--) {
How about is this?
How about is this?
I'll give it a whirl. Thanks for the suggestion. Will get back and let you know how it goes
Forum on trading, automated trading systems and testing trading strategies
Indicator freezes on start of new bar
Naguisa Unada, 2018.06.07 02:04
int limit; if (prev_calculated == 0) limit = rates_total - Delta; else limit = rates_total - prev_calculated + 1; for (int i = limit; i >= 0; i--) {
How about is this?
So I tried the code and it didn't work. But it got me thinking and I did this instead
int limit; if (prev_calculated == 0) limit = rates_total - Delta; else limit = rates_total - prev_calculated + 1; for(int i=0; i<limit; i++)
And for now it appears problem solved.
Which then leads to the next question. Why does it now work? Whats the logic the program is now applying that means one code doesn't work yet the smallest of variations and then it does.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So I have built my own custom currency strength meter. Here is an extract from the code
Looks like this when first applied to a chart
however as soon as a new bar is formed the indicator freezes leaving me with this
Can you help the worlds dumbest programmer. Thanks in advance
P.S I am happy to attach the full code if needed. It is just however the graphics component of the indicator.