Baseline Relative Performance - Updated Code

rmike

Well-Known Member
#1
With reference to this (closed) request thread on the subject

http://www.traderji.com/amibroker/101140-relative-performance-exploration.html#post1137335

Received a member request for displaying the output in a tabular format for a series of lookback periods, rather than for the end date only

Have implemented the same as a function of flexible lookback (periods) from the current (end) date. Intuitive Performance grading via a colour gradient in the tabular output has also been incorporated, as requested :). The thing to keep in mind is that a colour gradient is ideally suited for grading a bounded range e.g 0 -100 etc. However, with the Baseline Relative performance metric being of an unbounded nature (an instrument can overperform or underperform a chosen reference index by 1000%/ -1000% or any such % figure :)), the colour gradient is not optimally effective and is merely a minor visual guide, at best. The gradient has been configured such that values above +39% would be uniformly green and values below -39% would be uniformly red (the same as in the image sample sent by the requesting member).

In addition to these features, a few minor performance enhancements and a null check too has been incorporated for the latest version V 1.2.

A sample output of EOD Baseline Performance of Nifty Auto tickers vis-a-vis the Nifty50 Index from 09 Mar 2015 till date (last traded session) for a lookback of 8 periods (days) is as shown below



In the output, the extreme right column (highlighted by the blue rectangle) displays the most current figure. The rest of the columns from left to right display the performance figures/ changes beginning from the first period of the selected lookback (in this example the leftmost column title caption is BP - Baseline Performance followed by -8 - Eight days ago from last traded session).

For configuring params for the exploration in Automatic Analysis window, the procedure is similar to the previous versions (check the referenced request thread for instructions). An additional setting of lookback periods needs to be selected, as desired. The minimum lookback period is two and the max is 30. Defaulted to 9 periods which ought to be sufficient for most purposes :).



HTH

Regards,

P.S - Mod Base Rel Perf V1.2.afl
http://www71.zippyshare.com/v/oC6xpKHJ/file.html
 

amitrandive

Well-Known Member
#2
With reference to this (closed) request thread on the subject

http://www.traderji.com/amibroker/101140-relative-performance-exploration.html#post1137335

Received a member request for displaying the output in a tabular format for a series of lookback periods, rather than for the end date only

Have implemented the same as a function of flexible lookback (periods) from the current (end) date. Intuitive Performance grading via a colour gradient in the tabular output has also been incorporated, as requested :). The thing to keep in mind is that a colour gradient is ideally suited for grading a bounded range e.g 0 -100 etc. However, with the Baseline Relative performance metric being of an unbounded nature (an instrument can overperform or underperform a chosen reference index by 1000%/ -1000% or any such % figure :)), the colour gradient is not optimally effective and is merely a minor visual guide, at best. The gradient has been configured such that values above +39% would be uniformly green and values below -39% would be uniformly red (the same as in the image sample sent by the requesting member).

In addition to these features, a few minor performance enhancements and a null check too has been incorporated for the latest version V 1.2.

A sample output of EOD Baseline Performance of Nifty Auto tickers vis-a-vis the Nifty50 Index from 09 Mar 2015 till date (last traded session) for a lookback of 8 periods (days) is as shown below



In the output, the extreme right column (highlighted by the blue rectangle) displays the most current figure. The rest of the columns from left to right display the performance figures/ changes beginning from the first period of the selected lookback (in this example the leftmost column title caption is BP - Baseline Performance followed by -8 - Eight days ago from last traded session).

For configuring params for the exploration in Automatic Analysis window, the procedure is similar to the previous versions (check the referenced request thread for instructions). An additional setting of lookback periods needs to be selected, as desired. The minimum lookback period is two and the max is 30. Defaulted to 9 periods which ought to be sufficient for most purposes :).



HTH

Regards,

P.S - Mod Base Rel Perf V1.2.afl
http://www71.zippyshare.com/v/oC6xpKHJ/file.html
Thanks a million Sir , you are absolutely amazing !!!
Great coding skills , patience and help all nature.

:clapping::clapping::clapping:
 
#6
@rmike

Can you please share the AFL - Baseline Performance AFL. The zippy share link is not working.

Thanks,
Anuprem



With reference to this (closed) request thread on the subject

http://www.traderji.com/amibroker/101140-relative-performance-exploration.html#post1137335

Received a member request for displaying the output in a tabular format for a series of lookback periods, rather than for the end date only

Have implemented the same as a function of flexible lookback (periods) from the current (end) date. Intuitive Performance grading via a colour gradient in the tabular output has also been incorporated, as requested :). The thing to keep in mind is that a colour gradient is ideally suited for grading a bounded range e.g 0 -100 etc. However, with the Baseline Relative performance metric being of an unbounded nature (an instrument can overperform or underperform a chosen reference index by 1000%/ -1000% or any such % figure :)), the colour gradient is not optimally effective and is merely a minor visual guide, at best. The gradient has been configured such that values above +39% would be uniformly green and values below -39% would be uniformly red (the same as in the image sample sent by the requesting member).

In addition to these features, a few minor performance enhancements and a null check too has been incorporated for the latest version V 1.2.

A sample output of EOD Baseline Performance of Nifty Auto tickers vis-a-vis the Nifty50 Index from 09 Mar 2015 till date (last traded session) for a lookback of 8 periods (days) is as shown below



In the output, the extreme right column (highlighted by the blue rectangle) displays the most current figure. The rest of the columns from left to right display the performance figures/ changes beginning from the first period of the selected lookback (in this example the leftmost column title caption is BP - Baseline Performance followed by -8 - Eight days ago from last traded session).

For configuring params for the exploration in Automatic Analysis window, the procedure is similar to the previous versions (check the referenced request thread for instructions). An additional setting of lookback periods needs to be selected, as desired. The minimum lookback period is two and the max is 30. Defaulted to 9 periods which ought to be sufficient for most purposes :).



HTH

Regards,

P.S - Mod Base Rel Perf V1.2.afl
http://www71.zippyshare.com/v/oC6xpKHJ/file.html
 
#8
Hello, I need on one chart represt 10 index to add symbol in relative performance and I cannot with your code. Please, can yo help me?
1580740220551.png

Code:
_SECTION_BEGIN("Relative Performance");
SetChartOptions( 0, chartShowDates | chartShowArrows | chartWrapTitle );
_N( TickerList = ParamStr("Tickers", "846900,965881,B14000,CBK100,873403,850605,858872,875773,B40811") );

bi = BarIndex();
fvb = Max(0,BeginValue(bi));// Status("firstvisiblebar");
lvb = EndValue(bi);
barcond = bi >= fvb AND bi <= lvb;

Plot( IIf( barcond, 100 * ( C - C[ fvb ] ) / C[ fvb ], Null),FullName(), colorBlue );

for( i = 0; ( symbol = StrExtract( tickerlist, i ) ) != ""; i++ )
{
    //fc = Foreign( symbol, "C" );
    SetForeign( symbol );
        fc = C;

        if( ! IsNull( fc[ 0 ] ) )
        {
            Plot( IIf( barcond, 100 * ( fc - fc[ fvb ] ) / fc[ fvb ], Null), FullName() /*+ ", " + symbol*/, colorLightOrange + ( ( 2 * i ) % 15 ), styleLine );
        }
    RestorePriceArrays();
}
PlotGrid( 0, colorYellow );
_N( Title = "{{NAME}} - Relative Performance [%]: {{VALUES}}" );
_SECTION_END();
 

Similar threads