Custom Indicator Lesson 4 - Big Percentage Change Moves

Here is the Code for this indicator if you want to paste it in. I just pasted it from the editor to here. You can always swap indicators live on Updata Instant Messaging as well.

 

NAME BIG CHANGE(%)=
' This Indicator is to show up large percentage changes on the day - Set a parameter - so when this indicator is run a dialog box will be offered for entering the big change level
PARAMETER @LargeDayMove=2
' Set a starting level for the indicator - say 0
#BIGDAYS=0
' Set the date to zero ready for us to run through 1 by 1
#CURDATE=0
' Now run a loop to produce a value on each day
WHILE #CURDATE<=#LASTDATE
' If the PCHG rise is bigger than the paramater step line up by 1
IF (PCHG(CLOSE(0),1,0)>@LargeDayMove)
#BIGDAYS=#BIGDAYS+1
' If the fall is bigger than the paramater step line down by 1
ELSEIF IF (PCHG(CLOSE(0),1,0)<0-@LargeDayMove)
#BIGDAYS=#BIGDAYS-1
ENDIF

'Now plot the value on that date
@PLOT=#BIGDAYS
'Add 1 to date ready for next calculation
#CURDATE=#CURDATE+1
WEND
'Now this has finished it should plot a flat line with a step up of 1 whenever the day's rise is bigger and a step down when fall is bigger than that set at the parameter

 

Last week we looked at creating some custom indicators involving absolute change, now we look at percentages. Footsie was powering ahead this morning smashing through 5,900 points. Vodafone was the best perfomer in the index, up by over 4%. So looking at that, I wondered to myself "how often does that happen?" Here's the answer. Even when Vodafone was up near its 2000 peak, 4% daily changes were not rare. In the last few years despite the much lower price, 4% changes on the day have been much less common as we see below.

Now the real value of this simple new index (code below) is applying it to anything that takes your fancy. Here we look at daily 2% changes on Footsie and see that 2% up days in fact occurred most frequently at the end of the downtrend. In fact we had a few sharp pull backs early on in this new uptrend and have been stuck with changes of less than 2% for nearly two years now.

For me the real value of this simple new Custom Index is that you can apply beyond daily data. For instance how often does Footsie change over 3% in a week? Looking at the chart below we see there were lots of big change weeks for several years and now we have only had one in 3 years, the up thrust from the sell off last October.

Of course fund managers tend to think month to month. So lets look at how often we get 5% and 10% changes in a calendar month. Simply draw a monthly chart and put the indicator on for 5% and then 10% for the two lines below. Here we see that there have only been six 10% plus months in 20 years and we haven't had 5% or more in over 3 years now.

Let's look at the process to change this to Big Change (%). First give your indicator a new name so we change it to BIG CHANGE(%)=. This will not put "days" as the title on the chart window bar so it is good for any time frame.

Again, the really big change here is the condition at the IF statement. Now we are using a new command PCHG which if you type in and hover over gives you all the correct syntax on how to use it. You will see it in the code given below.

Here is the Code for this indicator if you want to paste it in. I just pasted it from the editor to here. You can always swap indicators live on Updata Instant Messaging as well.

NAME BIG CHANGE(%)=
' This Indicator is to show up large percentage changes on the day - Set a parameter - so when this indicator is run a dialog box will be offered for entering the big change level
PARAMETER @LargeDayMove=2
' Set a starting level for the indicator - say 0
#BIGDAYS=0
' Set the date to zero ready for us to run through 1 by 1
#CURDATE=0
' Now run a loop to produce a value on each day
WHILE #CURDATE<=#LASTDATE
' If the PCHG rise is bigger than the paramater step line up by 1
IF (PCHG(CLOSE(0),1,0)>@LargeDayMove)
#BIGDAYS=#BIGDAYS+1
' If the fall is bigger than the paramater step line down by 1
ELSEIF IF (PCHG(CLOSE(0),1,0)<0-@LargeDayMove)
#BIGDAYS=#BIGDAYS-1
ENDIF

'Now plot the value on that date
@PLOT=#BIGDAYS
'Add 1 to date ready for next calculation
#CURDATE=#CURDATE+1
WEND
'Now this has finished it should plot a flat line with a step up of 1 whenever the day's rise is bigger and a step down when fall is bigger than that set at the parameter

Tomorrow we are going to start looking at creating your own indices. Try it yourself, it's very satisfying. We will do a new lesson each day, so join me now before I get too far down the line. Once you start to see some of the powerful indicators emerging you will be amazed.

We provide this daily service to our customers by sending interesting example charts with some
Technical Analysis commentary. This is not a tips service. This email is designed to help you
get more from your Updata system by giving you worked examples of really useful analysis
techniques. We will get more and more advanced as we go. Thank you for all your request emails.
Please note we cannot give advice or cover specific stock requests.

For more comprehensive market coverage and a full Tipping Service please visit -
Tipstracker.com

Updata plc
www.updata.co.uk
Tel: 020 8874 4747
technicalanalysis@updata.co.uk