Offline charts have a problem when are update with win32 hack. They force to indicator to update all bars. This class fix this problem. Only refresh new bars. This speed up very much MT4. In my test with backtest and 5 offline charts updated at same time, all charts are refresh without drop ticks.
You only have replace:
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=MathMin(Bars-counted_bars,Bars-1);
for this:
If you use "for( i=limit-1..."
int limit = Bar::tick();
or If you use "for( i=limit..."
int limit = Bar::tick() - 1;
PS: I test this with indicator i use and all is fine. Many indicators are this web.
Bar.mqh
You only have replace:
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit=MathMin(Bars-counted_bars,Bars-1);
for this:
If you use "for( i=limit-1..."
int limit = Bar::tick();
or If you use "for( i=limit..."
int limit = Bar::tick() - 1;
PS: I test this with indicator i use and all is fine. Many indicators are this web.
Bar.mqh
Try don't lose pants never...