Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Reducing Indicator-Lag for Amibroker (AFL)
meralim
almost 14 years ago
Amibroker (AFL)

Rating:
2 / 5 (Votes 3)
Tags:
amibroker, kb

Source: http://www.amibroker.org/userkb/2011/01/06/reducing-indicator-lag-2

Posted: January 6, 2011

The usual way to reduce Indicator lag in averaging formulas, such as the MA, is to try and dream up a completely new formula. This isn’t easy. It is often easier to remove lag from an already smoothed plot, than to improve the basic smoothing formula.

Indicator Delay is often an essential Indicator quality and (imo) is not the same as Indicator Lag. The ideal smoothing function is one with zero delay, i.e., one that tracks the price with a perfectly smooth-looking plot. Delay can be added later as an independent quality using the ref() function. Some smoothing formulas already have a sensitivity adjustment, these will not necessarily behave in the same manner as the LagReducing factor used below. Optimizing all parameters for best results is recommended.

The Lag-Reducing formula presented here can be applied to most averaging formulas and to indicators that are based on averages (like Bands). The lag reducing parameter (RLFactor) of the Reducelag() function can also be used to make formulas adaptive with respect to another price or Indicator quality. The image below shows how lag has been reduced for the Tilson T3 formula.

Screenshots

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn almost 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly almost 13 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
Interactive Linear Regression Channel
Submitted by InternetWorm almost 13 years ago
*Level Breakout system*
Submitted by Tinych about 13 years ago

Indicator / Formula

Copy & Paste Friendly
function T3( Price, T3Periods, s )
{
    e1	= AMA( Price, 2 / ( T3Periods + 1 ) );
    e2	= AMA( e1, 2 / ( T3Periods + 1 ) );
    e3	= AMA( e2, 2 / ( T3Periods + 1 ) );
    e4	= AMA( e3, 2 / ( T3Periods + 1 ) );
    e5	= AMA( e4, 2 / ( T3Periods + 1 ) );
    e6	= AMA( e5, 2 / ( T3Periods + 1 ) );
    C1 = -s ^ 3;
    C2 = 3 * s ^ 2 * ( 1 + s );
    C3 = -3 * s * ( s + 1 ) ^ 2;
    C4 = ( 1 + s ) ^ 3;
    T3Result = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3;
    return Nz( T3Result );
}
 
function ReduceLag( Indicator, RLFactor )
{
    return ( Indicator / Ref( Indicator, -1 ) ) ^ RLFactor*Indicator;
}
 
_SECTION_BEGIN( "REDUCING INDICATOR LAG" );
LRFactor 		= Param( "Lag-Reducing Factor", 1.7, 0, 10, 0.1 );
Periods 		= Param( "T3 Periods", 5, 1, 10, 1 );
Sensitivity		= Param( "T3 Sensitivity 1", 0.7, 0, 3, 0.03 );
 
I1 = T3( O, Periods, Sensitivity );
I2 = Reducelag( I1, LRFactor );
 
Plot( C, "Close", 1, 128 );
Plot( I1, "\nBasic T3", 2, 1 );
Plot( I2, "\nLag-Reduced T3", 4, 1 | styleNoRescale );
_SECTION_END();

1 comments

1. isfandi

perfect, good job

Leave Comment

Please login here to leave a comment.

Back