Indicators Optimized for Offline Charts

 

This section should contain only indicators that are safe for use in offline charts. By safe I mean they do not recalculate entire chart with every new tick.

As many may know, most indicators have high power consumption when placed on offline chart. It is due to different refresh mechanism of the offline charts. I am starting to replace indicators I have been using with "offline safe" ones, and I am willing to share them.

Please feel free to share your modifications of public indicators that are "offline safe".

Both mq4 and ex4 are welcome. (ex4 when the code contains dependencies that are not comfortable to share).

 

Keltner Channel

Definition of Keltner Channel at Investopedia

Keltner.ex4

Files:
keltner.png  55 kb
 

Bollinger Bands

Just ordinary Bollinger Bands with offline charts modification.

Bollinger Bands on Investopedia.

Bands.ex4

Files:
bands.png  53 kb
 

Here is one more for the collection - double smoothed stiochastic of adaptive super smoother : dss_of_adaptive_super_smoother_ols.ex4

 

ATR (MT4 version)

MT4 ATR modified for offline charts.

Definition on Investopedia

ATR.ex4

Files:
atr.png  44 kb
 

Bill Williams' Alligator

Bill Williams' Alligator (MT4 version) modified for offline charts.

Description on MQL4 site

Alligator.ex4

Files:
alligator.png  55 kb
 

Angle of T3 offline charts safe : angle_of_t3_2_ols.ex4

PS: all these indicators should work correctly on regular charts too. What they are doing is correcting one nonsense that exists in new metatrader when it comes to offline charts - on regular charts they work the same way as any other regular indicator

 

Commodity Channel Index

A standard MT4 CCI in "offline safe" version.

Definition of CCI on Investopedia

CCI.ex4

Files:
cci.png  43 kb
 
mladen:
... PS: all these indicators should work correctly on regular charts too. What they are doing is correcting one nonsense that exists in new metatrader when it comes to offline charts - on regular charts they work the same way as any other regular indicator

Thank you for the note.

Yes, the main part is replacement for IndicatorCounted() function, which must work the same way the original works in a regular chart, while an alternate way in offline charts.

If you compare original & alternate functions in the offline chart (replacement in the left, original in the right), the replacement must avoid zero:

13:07:42 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3028 - 3028

13:07:43 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3028 - 0

13:07:43 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 3029

13:07:44 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 0

13:07:44 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 3029

While in a regular chart they must return identical value:

13:04:01 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69321 - 69321

13:04:04 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

13:04:06 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

13:04:07 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

 
Ovo:
Thank you for the note.

Yes, the main part is replacement for IndicatorCounted() function, which must work the same way the original works in a regular chart, while an alternate way in offline charts.

If you compare original & alternate functions in the offline chart (replacement in the left, original in the right), the replacement must avoid zero:

Thanks for starting a thread that i interested

13:07:42 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3028 - 3028

13:07:43 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3028 - 0

13:07:43 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 3029

13:07:44 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 0

13:07:44 Keltner GBPUSD,H5: IndicatorCounted comparison new-old : 3029 - 3029

While in a regular chart they must return identical value:

13:04:01 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69321 - 69321

13:04:04 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

13:04:06 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

13:04:07 Keltner GBPUSD,M1: IndicatorCounted comparison new-old : 69322 - 69322

Thanks for starting a nice thread that i interested .

Here is one of my favored indi ,

fr-trendlines.ex4

Files:
 

If the solution is just a little programming trick, I think this thread does not have any purpose.

If you are sharing only ex4 code, we can not check if there is any improvement.

Wanting not to expose the community ideas, so they are not used for commercial purposes it leads to results as Range EA released here.

With the worst aspect I've ever seen, All candles are separated by gaps.