Relative Performance Exploration

Status
Not open for further replies.

amitrandive

Well-Known Member
#1
Dear All,

I want to have an exploration for the Relative performance of any or a group of stocks as compared to an Index(Nifty or BankNifty or any sectoral Indices) on any time frame.(Also includes any date range)

I am using the relative performance code below taken from
http://www.amibroker.com/kb/2015/08/29/how-to-add-symbol-labels-to-relative-performance-chart/

Code:
_N( TickerList = ParamStr( "Tickers", "^DJI,MSFT,GE" ) );
fontsize = Param("Label font size", 10, 4, 30, 1 );
fvb = Status( "firstvisiblebar" );

for( i = 0; ( symbol = StrExtract( Name() + "," + TickerList, i ) ) != ""; i++ )
{
    fc = Foreign( symbol, "C" );

    if( ! IsNull( fc[ 0 ] ) )
    {
        relP = 100 * ( fc - fc[ fvb ] ) / fc[ fvb ];
        Plot( relP , symbol, color = colorLightOrange + ( ( 2 * i ) % 15 ), styleLine );

        x = LastValue( BarIndex() ) + 1;
        y = LastValue( relP );

        PlotTextSetFont( symbol, "Arial", fontsize, x, y, GetChartBkColor(), color, -fontsize/2 );
    }
}

PlotGrid( 0, colorYellow );
The chart for this is

 
Last edited:

rmike

Well-Known Member
#2
Relative performance is primarily a macro strategy tool for comparatively stronger vehicle/ scrip selection

The entry, post selection, is governed by tactics/ setups pertaining to shorter term (micro) technical cues

Posting the Baseline Relative Performance AFL, modified for choice of Index, Watchlist & Start Date for TraderJi Members

Put your tickers under review in a designated chosen Watchlist. Select Index, Watchlist Number & Start Date from AFL 'Parameters' and you are good to go

The AFL will work for intraday timeframes too, referencing from the EOD close of the chosen Start Date BUT is NOT Recommended for intraday use because a quicker way to judge relative performance is by sorting watchlist as per 'quantum of change' on the trading terminal AND because the calculations required for a large universe of tickers will substantially degrade platform performance in real time AND also, once again, Relative Performance is Not a tool to catch very short term fluctuations

'Nuff Said :)

Chart Example of 'Nifty Growth Index' Tickers compared (EOD) w.r.t to Nifty50 from 01 Dec 2015 till date



P.S - AFL - http://www43.zippyshare.com/v/056mnpFw/file.html
 

copypasteaee

Humbled by Markets
#3
Relative performance is primarily a macro strategy tool for comparatively stronger vehicle/ scrip selection

The entry, post selection, is governed by tactics/ setups pertaining to shorter term (micro) technical cues

Posting the Baseline Relative Performance AFL, modified for choice of Index, Watchlist & Start Date for TraderJi Members

Put your tickers under review in a designated chosen Watchlist. Select Index, Watchlist Number & Start Date from AFL 'Parameters' and you are good to go

The AFL will work for intraday timeframes too, referencing from the EOD close of the chosen Start Date BUT is NOT Recommended for intraday use because a quicker way to judge relative performance is by sorting watchlist as per 'quantum of change' on the trading terminal AND because the calculations required for a large universe of tickers will substantially degrade platform performance in real time AND also, once again, Relative Performance is Not a tool to catch very short term fluctuations

'Nuff Said :)

Chart Example of 'Nifty Growth Index' Tickers compared (EOD) w.r.t to Nifty50 from 01 Dec 2015 till date



P.S - AFL - http://www43.zippyshare.com/v/056mnpFw/file.html
if there are more than 4-5 scripts in watchlist then the values could not be read. can you insert \n between script names. sorry my programming skills are very limited
 

rmike

Well-Known Member
#4
if there are more than 4-5 scripts in watchlist then the values could not be read
Relative Performance values of all tickers w.r.t chosen Index will be displayed in the title. Simply go to 'Axes & Grid' tab of the Params Window and toggle 'Wrap title' to 'Yes'



The colours of the individual performance graphs are auto assigned and hence some may merge with chart background. You will have to temporarily change chart background colour to white/ light grey to read off all values, if you wish to do so
 

amitrandive

Well-Known Member
#6
Relative performance is primarily a macro strategy tool for comparatively stronger vehicle/ scrip selection

The entry, post selection, is governed by tactics/ setups pertaining to shorter term (micro) technical cues

Posting the Baseline Relative Performance AFL, modified for choice of Index, Watchlist & Start Date for TraderJi Members

Put your tickers under review in a designated chosen Watchlist. Select Index, Watchlist Number & Start Date from AFL 'Parameters' and you are good to go

The AFL will work for intraday timeframes too, referencing from the EOD close of the chosen Start Date BUT is NOT Recommended for intraday use because a quicker way to judge relative performance is by sorting watchlist as per 'quantum of change' on the trading terminal AND because the calculations required for a large universe of tickers will substantially degrade platform performance in real time AND also, once again, Relative Performance is Not a tool to catch very short term fluctuations

'Nuff Said :)

Chart Example of 'Nifty Growth Index' Tickers compared (EOD) w.r.t to Nifty50 from 01 Dec 2015 till date



P.S - AFL - http://www43.zippyshare.com/v/056mnpFw/file.html
Rmike

Thanks for the code !!!
Can this code be modified further to add an exploration from the selected start date for the watchlist?

Thanks again for spending your time on this detailed reply and modification.
 

rmike

Well-Known Member
#7
Can this code be modified further to add an exploration from the selected start date for the watchlist?
Sure can! :)
Version 1.1

Replace v1.0 with 1.1

Send to Automatic Analysis
Set desired parameters in settings of AA window (Index, Watchlist, Start Date)
Set Apply to - filer (Watchlist Number)
Set Range to 1 days/1 recent bars
Click on explore and you are done

Output is colour coded (Green for equal to or greater than Index & Red for lesser than Index) with auto column sort in descending order

Example: Baseline Relative Performance of 'Nifty Value20' Tickers w.r.t Nifty Junior (NiftyNext50), from 01 Nov 15 as on last traded date



P.S - v1.1 http://www100.zippyshare.com/v/80bqXC7H/file.html
 

amitrandive

Well-Known Member
#8
Sure can! :)
Version 1.1

Replace v1.0 with 1.1

Send to Automatic Analysis
Set desired parameters in settings of AA window (Index, Watchlist, Start Date)
Set Apply to - filer (Watchlist Number)
Set Range to 1 days/1 recent bars
Click on explore and you are done

Output is colour coded (Green for equal to or greater than Index & Red for lesser than Index) with auto column sort in descending order

Example: Baseline Relative Performance of 'Nifty Value20' Tickers w.r.t Nifty Junior (NiftyNext50), from 01 Nov 15 as on last traded date



P.S - v1.1 http://www100.zippyshare.com/v/80bqXC7H/file.html
Thank you very much !!!
:clapping::clapping::clapping:
 

amitrandive

Well-Known Member
#9
Trash

This is a warning, either stay away from my threads or contribute in a positive way.

Don't be be a looser , nerdy geek who has been bullied by in his ridiculously wimpy childhood.

You narcissist troll, I am not impressed by you stupid knowledge.Either grow up and mature or be like your stinking name and spread the negativity in the entire forum.

This is the second time you have crossed the limit and it won't be the last, I know loosers like you.If you think you are smart or arrogant or sarcastic, go stay in your cubicle and impress your geeky colleagues.

If you have the guts , I dare you to use your real name and then try and attack people instead of hiding behind an alias,you tiny whiny,pathetic jerk.

Lots of people who have the will , patience and humility to help in this forum.
 
Last edited:

copypasteaee

Humbled by Markets
#10
So some (incompetent) whiner (we all know who it is) has deleted my post about lazy copy&paste artists not respecting other people's invested time and the same post even providing the way to one out of million solutions. Hilarious!

EDIT: Just have seen that by "some magic" the link to the original source has been suddenly added. So obviously I was right since guilty conscience stepped in. Funniness part II.
you referring me in this post? write in simpler language, hard to understand what you want to convey.
 
Status
Not open for further replies.

Similar threads