• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:47am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:47am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Auto Refresh All TimeFrames' Chart Data + showing Spread 3 replies

How do I get this code to refresh my chart every 5 seconds? 6 replies

Good indicator, needing a refresh fix. How to correct it? 0 replies

Refresh mt4 chart every tick 3 replies

Refresh Chart Script? 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Fix offline chart refresh (speed up)

  • Post #1
  • Quote
  • First Post: Sep 20, 2014 5:26am Sep 20, 2014 5:26am
  •  braintheboss
  • Joined Nov 2012 | Status: Coder | 8,486 Posts | Online Now
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
Try don't lose pants never...
  • Post #2
  • Quote
  • Jul 7, 2021 4:54am Jul 7, 2021 4:54am
  •  EnrichWave
  • | Joined May 2018 | Status: Professional Trader | 74 Posts
Quoting braintheboss
Disliked
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()...
Ignored
Could you please post that updated indicator?.

Kind Regards
 
 
  • Post #3
  • Quote
  • Jul 7, 2021 6:59am Jul 7, 2021 6:59am
  •  braintheboss
  • Joined Nov 2012 | Status: Coder | 8,486 Posts | Online Now
Quoting EnrichWave
Disliked
{quote} Could you please post that updated indicator?. Kind Regards
Ignored
Its a class for add to your indicator...
Try don't lose pants never...
 
 
  • Post #4
  • Quote
  • Jul 7, 2021 7:02am Jul 7, 2021 7:02am
  •  EnrichWave
  • | Joined May 2018 | Status: Professional Trader | 74 Posts
Quoting braintheboss
Disliked
{quote} Its a class for add to your indicator...
Ignored
Dear Braintheboss,

I'm not a coder. But I can understand little bit about coding and can modify small portions. Kindly elaborate fully.

Kind Regards
 
 
  • Post #5
  • Quote
  • Last Post: Jul 8, 2021 6:01pm Jul 8, 2021 6:01pm
  •  losja
  • | Joined Jan 2013 | Status: Member | 66 Posts
Quoting EnrichWave
Disliked
{quote} Dear Braintheboss, I'm not a coder. But I can understand little bit about coding and can modify small portions. Kindly elaborate fully. Kind Regards
Ignored
If I'm not wrong about what's going on here. Just follow this approach:

Inserted Code
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[])
{
   static int my_prev_calculated = 0;
   
   /*
      Use here my_prev_calculated in places where
      you used pre_calculated and IndicatorCounted()
      and you are done.
   */
   
   
   my_prev_calculated = rates_total;      
   return(rates_total);
}
Algos Coder
 
 
  • Platform Tech
  • /
  • Fix offline chart refresh (speed up)
  • Reply to Thread
0 traders viewing now
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022