How to create a custom technical ranking system

How to create a custom technical ranking system

In your studies you may have come across the ‘weight of evidence’ approach to investing which looks at prices and various indicators to help identify potential trading opportunities.

In your studies you may have come across the ‘weight of evidence’ approach to investing which looks at prices and various indicators to help identify potential trading opportunities. Let’s say that as a momentum investor you look for opportunities by studying the price relationship to various moving averages, the positive or negative slope of the moving average, the RSI value, and the rate of change. You could save the indicators to a Page Layout and apply it to hundreds of charts and manually plough through them to visualise those that look good - or bad - whilst jotting the tickers down as you go, but that takes time – not to mention a toll on your eyes!

Another solution would be to use the Optuma scripting language to do all the work for you. By assigning values to certain technical conditions you can create your own technical weight of evidence methodology - or custom ranking system.

Here are five indicators that you may look for to determine whether further analysis should be undertaken:

  1. the price relationship to moving averages, eg is the current price above the 50MA?
  2. the slope of a moving average, eg is the 13EMA sloping up?
  3. the value of two moving averages, eg is the 33MA greater than the 88MA?
  4. RSI values, eg RSI(10) is above its 10MA
  5. positive recent gains, eg rate of change over last 3 months is positive.

NOTE: these have been chosen as an example only and should not be used in your analysis without further study.

By default, when a true/false condition is calculated by Optuma a true result is given a value of one, and zero if false. So if we build a formula containing those five conditions above and sum the results we will be able to easily see those stocks where all the conditions are true (the total will be five), where all are false (0), and everything else in between. Note that we won’t know which of the five conditions are true, just the overall number. However, we can adjust the values for each condition so those that you deem more important can have a higher weighting – more on that in a follow up article.

Here are the five true/false conditions based on the list above that can be added to a custom watchlist column. Remember when starting a line with // that the text that follows is ignored, allowing you to add comments or descriptions:

1
2
3
4
5
6
7
8
9
10
11
12
// Currently trading above the MA50?
V1 = CLOSE()> MA(BARS=50, CALC=Close);
// The 13EMA is sloping up?
V2 = MA(BARS=13, STYLE=Exponential, CALC=Close) IsUp;
// Is the MA33 is above MA88?
V3 = MA(BARS=33, CALC=Close) > MA(BARS=88, CALC=Close);
// Is the RSI(10) above its 10MA?
V4 = RSI(BARS=10) > MA(RSI(BARS=10), BARS=10);
// Positive returns over last 3 months?
V5 = ROC(Month(PERIODAMOUNT=1), BARS=3) > 0;
// Sum the results to get a ranking value
V1+V2+V3+V4+V5

The last line calculates the sum of the results to display a value, so that the stocks where all five conditions are true will have a ranking value of five, whilst those scoring zero will obviously have no true results. In the example on the right a custom column has been added to a watchlist of the ASX200 with the above example ranking formula being used. This column can be sorted, grouped, and also displayed with a custom label and colour. As you can see in the snippet of the watchlist, BSL, BWP, and CAR have a ranking of five, whilst BOQ, BXB and CBA are all zeroes.

Custom Rank Custom Rank

Creating a Time Series

Once the column has been added to the watchlist then a time series of the ranking value can then be added to a chart by clicking on the column heading and dragging it on to the chart to display it in a new view (tip: once added right-click on the line and change the Plot Style to Shaded Step).

Rank Rank

Custom Bar Colours

Using the same ranking example you can also assign specific bar colours for each value. For example, those bars that have a ranking value of zero are bright red, ones are maroon, twos are pink, etc.

To do this right-click on any bar and change the colour scheme to Custom and then create a formula for each value with the colour as required.

TIP: if you save the original script and give it a name, it can then be referenced by other formulas using the SCRIPT() function.

All that needs to be changed for each colour is the value, so for red bars denoting a rank of zero use the following, remembering to use the double equals sign (==) to denote equality (single equals signs are used to assign variables).

//Get the original saved script, called MyRank;
SCRIPT(SCRIPTNAME=MyRank)==0

The next colour for those with a ranking of 1 would have ==1, and so on.

Once all the colours have been added the chart would look like this:

Rank Bar Colours

Clients subscribed to ASX or US data can click the buttons below to save and open the workbook examples.

Let us know what you think, and feel free to post your scripts or queries on the client forum.