Print Page | Close Window

True Comparative Strength

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=679
Printed Date: 18 May 2024 at 1:58pm
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: True Comparative Strength
Posted By: maximo
Subject: True Comparative Strength
Date Posted: 30 Oct 2010 at 6:00pm
Hiya's
 
I've had this on the drawing board for a few weeks just needed to get around to coding it.
It compares any stock with an index without the use of averages or indicators. ie. It sums the percentage change of both a stock versus an index over N period.
 
The reason for not using any averages may not be clear, but firstly you eliminate lag and at the same time you eliminate the exponential error factor due to averages becoming less accurate with each successive bar.   eg. a 14 period average drops the bar 15 bars back from the average so each successive calculation becomes 1/14; 7% less accurate over a longer term.  The idea is to have a precise comparison instead of one which degrades over time.
 
Now for some ideas on how to use the indicator.   You can suggest them if you have any.
One idea is to make your own index of stocks which would be likely to outperform the index comparison.   You could construct a rating model for example to seek out the best performers.  Example is the ASX20 stocks compared to ASX200, a +ive attribute represents over performing and -ive  for under performing.  Holding good performers can be an objective for both traders & investors.
 
Rating   Stock  Weekly Daily
             AMP    -            -
1           ANZ    +           +
2           BHP    +           +
             BXB    -            -
             CBA    +           -  
             CSL     -           -
             FGL     -           -
             MQG   -           +
             NAB    +          -
3           NCM   +          +
             ORG   -           - 
             QBE   -           -
4            RIO    +          +
5            SUN   +          +
              TSL    -           -
             WBC   +          -
             WDC   -           -
6           WES   +          +
             WOW  -           -
              WPL   +          -
 
 
note: This is not a recommendation to buy or sell.
 
 

[Description="True Comparative Strength, Max (c) Copyright 2010"]

index := inputsymbol("Compare to", "XJO");

lookback:= input("period",100,1);

start:=barnumber > lastvalue(barnumber) - lookback;

[color=lime green]

{ Sum price percentage change relative to lookback period ago }

if(start,( (((Close-ref(Close,-1)) / ref(Close,-1))*100) + prev),prev);

[color=blue]

if(start,( (((LoadSymbol(index,C)-ref(LoadSymbol(index,C),-1)) / ref(LoadSymbol(index,C),-1))*100) + prev),prev);




Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk