Registered User Joined: 2/18/2006 Posts: 4
|
Hi I am currently in the process of reviewing your software prior to possibly subscribing to your services. At the moment I have a version of Metastock on my PC which has an indicator called Relative Momentum Index. I cannot so far find any reference to this on your website, could you please tell me if,in fact this is available on your software
Regards
Gordon
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
It is not a built in condition in the system but I looked it up and we could make it using the Custom Indicator feature.
Give me the settings you use in MetaStock and I will translate it for TeleChart...
- Craig Here to Help!
|
|
Registered User Joined: 2/18/2006 Posts: 4
|
Thanks for your reply Craig... Below are the parameters I am using plus some basic info on RMI which might be of use... Regards Gordon
Relative Momentum Index The Relative Momentum Index (RMI) was developed by Roger Altman. Impressed with the Relative Strength Index's insensitivity to the number of lookback periods, yet frustrated with it's inconsistent oscillation between defined overbought and oversold levels, Mr. Altman added a momentum component to the RSI. The RMI was first introduced in the February 1993 issue of Technical Analysis of Stocks & Commodities magazine. As mentioned, the RMI is a variation of the RSI indicator. Instead of counting up and down days from close to close as the RSI does, the RMI counts up and down days from the close relative to the close x-days ago (where x is not necessarily 1 as required by the RSI). So as the name of the indicator reflects, "momentum" is substituted for "strength." See page 149 for more information on plotting indicators. See page 180 for more information on the Relative Momentum Index parameters. Interpretation As an oscillator, the RMI exhibits the same strengths and weaknesses of other overbought/oversold indicators. During strong trending markets the RMI will remain at overbought or oversold levels for an extended period. However, during non-trending markets, the RMI tends to oscillate predictably between an overbought level of 70 to 90 and an oversold level of 10 to 30. Since the RMI is based on the RSI, many of the same interpretation methods can be applied. In fact, many of these "situations" are more clearly manifest with the RMI than they are with the RSI. Tops and Bottoms. The RMI usually tops above 70 and bottoms below 30. The RMI usually forms these tops and bottoms before the underlying price chart. Chart Formations. The RMI often forms chart patterns (such as head and shoulders or rising wedges) that may or may not be visible on the price chart. Failure Swings. (Also known as support or resistance penetrations or breakouts.) This is where the RMI surpasses a previous high (peak) or falls below a recent low (trough). Support and Resistance. The RMI shows, sometimes more clearly than the price chart, levels of support and resistance. Divergence. As discussed above, this occurs when the price makes a new high (or low) that is not confirmed by a new RMI high (or low). Note that a 20,1 parameter RMI is equivalent to a 20-period RSI. This is because the 1-day momentum parameter is calculating day-to-day price changes, which the standard RSI does by default. As the momentum parameter is increased, the oscillation range of the RMI becomes wider and the fluctuations become smoother.
I am using two RMI indicators on the same graph with parameters as follows
First Indicator Second indicator Time Period 6 14 Momentum 7 5
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
I think I understand...
Here is a custom indictator to try: (if you are not familiar with how to plot a custom indicator, please watch this first: Plotting Custom Indicators with Examples
Try this for your "first indicator" 6 and 7
100-(100/(1+((( (ABS(C>C7)*(C-C7))+ (ABS(C1>C8)*(C1-C8))+ (ABS(C2>C9)*(C2-C9))+ (ABS(C3>C10)*(C3-C10))+ (ABS(C4>C11)*(C4-C11))+ (ABS(C5>C12)*(C5-C12)) )/( ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) + ( ABS(C>C7)+ ABS(C1>C8)+ ABS(C2>C9)+ ABS(C3>C10)+ ABS(C4>C11)+ ABS(C5>C12) ) )) / ( (ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12)+ ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) )+ (( ((C<C7)*(C-C7))+ ((C1<C8)*(C1-C8))+ ((C2<C9)*(C2-C9))+ ((C3<C10)*(C3-C10))+ ((C4<C11)*(C4-C11))+ ((C5<C12)*(C5-C12)) )/( ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12) + ( ABS(C<C7)+ ABS(C1<C8)+ ABS(C2<C9)+ ABS(C3<C10)+ ABS(C4<C11)+ ABS(C5<C12) ) )) ))))
If its values match your other program's 6/7 RMI then I can spit out the 14/5 one for you.
- Craig Here to Help!
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Craig,
Your PCF embodies quite an interesting way to avoid divide by zero. It is perfectly accurate except in the case where there are up-changes and no down-changes. In that case, the value should be 100, but can be well below that. Unfortunately, the PCF can return larger values when there are down-changes than when there are none.
A cure for this problem is:
100-(100/(1+((( (ABS(C>C7)*(C-C7))+ (ABS(C1>C8)*(C1-C8))+ (ABS(C2>C9)*(C2-C9))+ (ABS(C3>C10)*(C3-C10))+ (ABS(C4>C11)*(C4-C11))+ (ABS(C5>C12)*(C5-C12)) )/( 0.000001*ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) + ( ABS(C>C7)+ ABS(C1>C8)+ ABS(C2>C9)+ ABS(C3>C10)+ ABS(C4>C11)+ ABS(C5>C12) ) )) / ( (ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12)+ ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) )+ (( ((C<C7)*(C-C7))+ ((C1<C8)*(C1-C8))+ ((C2<C9)*(C2-C9))+ ((C3<C10)*(C3-C10))+ ((C4<C11)*(C4-C11))+ ((C5<C12)*(C5-C12)) )/( ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12) + ( ABS(C<C7)+ ABS(C1<C8)+ ABS(C2<C9)+ ABS(C3<C10)+ ABS(C4<C11)+ ABS(C5<C12) ) )) ))))
The only change is the 0.000001 factor. I apologize for destroying the beauty.
You have some how been led to believe that the sum of the up-changes should be divided by the number of up-changes and similarly for the down-changes. This can lead to quite undesirabe results. For example, a single moderate up-change amid a sea of down-changes can result in a value well above 50.
I believe your PCF should be changed to:
100-100/(1- ((C>C7)*(C-C7)+ (C1>C8)*(C1-C8)+ (C2>C9)*(C2-C9)+ (C3>C10)*(C3-C10)+ (C4>C11)*(C4-C11)+ (C5>C12)*(C5-C12)) /((C<C7)*(C-C7)+ (C1<C8)*(C1-C8)+ (C2<C9)*(C2-C9)+ (C3<C10)*(C3-C10)+ (C4<C11)*(C4-C11)+ (C5<C12)*(C5-C12)+0.00001))
or something similar.
Thanks, Jim Murphy
|
|
Registered User Joined: 2/18/2006 Posts: 4
|
Hi Craig Thanks for your effort on the momentum index. I have looked at it and it appears almost right...well done The main problem seems to be that the top and bottom extremes of the oscillating curve seems to be truncated quite frequently and this is an important aspect since it helps to define entry points relative to previous extremes. If you could correct this I think this would do it. If you could then do the same for the 14/5 line that would be wonderful.... thanks again for your help
Regards
Gordon
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
bustermu,
All of the info I found on the indicator asked average ups to be divided by the average down nets. It is not the sum of the up nets dividing by the sum of the down nets.
rgevans, I will be back with another take on this.
- Craig Here to Help!
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
QUOTE (Craig_S) All of the info I found on the indicator asked average ups to be divided by the average down nets. It is not the sum of the up nets dividing by the sum of the down nets.
When they say "average ups", if an entity is not an "up", it is intended to be replaced by zero, and similarly for "average downs". Thus,
(average ups)/(average downs) = (sum of ups)/(sum of downs)
If you use
[(sum of ups)/(# of ups)]/[(sum of downs)/(# of downs)],
you will get very undesirable results when the number of ups is not near the number of downs. That is most of the problem Gordon sees.
Thanks, Jim Murphy
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
rgevas,
Would you plot bustermu's version
100-100/(1- ((C>C7)*(C-C7)+ (C1>C8)*(C1-C8)+ (C2>C9)*(C2-C9)+ (C3>C10)*(C3-C10)+ (C4>C11)*(C4-C11)+ (C5>C12)*(C5-C12)) /((C<C7)*(C-C7)+ (C1<C8)*(C1-C8)+ (C2<C9)*(C2-C9)+ (C3<C10)*(C3-C10)+ (C4<C11)*(C4-C11)+ (C5<C12)*(C5-C12)+0.00001))
and see if it is closer to your indicator than mine so we can see if it is actully the ratio of the sums vs the ratio of the averages?
- Craig Here to Help!
|
|
Registered User Joined: 2/18/2006 Posts: 4
|
Hi Craig I have tried Jim's formula and this seems to give broady similar results to your original. Some of the minor swings which are within the chart area seem to be more accurate in terms of their relative positions to other points on the chart, and this is an improvement, however the main problem is still the truncating of the extreme turning points, and this appears to be almost identical. The oscillator will normally move between +100 and 0 with overbought and oversold horizontal lines at +70 and +30. I think you are pretty close to solving this. Other than the extreme positions the central portion of the graph looks about right and in line with what I am getting on my Metastock software
Thanks for your help guys
Regards
Gordon
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Gorden,
There is something bad wrong. The first thing is that Craig's original and the PCF I supplied do not even resemble one another.
Please plot:
PCF1: 100-(100/(1+((( (ABS(C>C7)*(C-C7))+ (ABS(C1>C8)*(C1-C8))+ (ABS(C2>C9)*(C2-C9))+ (ABS(C3>C10)*(C3-C10))+ (ABS(C4>C11)*(C4-C11))+ (ABS(C5>C12)*(C5-C12)) )/( ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) + ( ABS(C>C7)+ ABS(C1>C8)+ ABS(C2>C9)+ ABS(C3>C10)+ ABS(C4>C11)+ ABS(C5>C12) ) )) / ( (ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12)+ ABS(C<=C7 AND C1<=C8 AND C2<=C9 AND C3<=C10 AND C4<=C11 AND C5<=C12) )+ (( ((C<C7)*(C-C7))+ ((C1<C8)*(C1-C8))+ ((C2<C9)*(C2-C9))+ ((C3<C10)*(C3-C10))+ ((C4<C11)*(C4-C11))+ ((C5<C12)*(C5-C12)) )/( ABS(C>=C7 AND C1>=C8 AND C2>=C9 AND C3>=C10 AND C4>=C11 AND C5>=C12) + ( ABS(C<C7)+ ABS(C1<C8)+ ABS(C2<C9)+ ABS(C3<C10)+ ABS(C4<C11)+ ABS(C5<C12) ) )) ))))-50
and
PCF 2: 100-100/(1- ((C>C7)*(C-C7)+ (C1>C8)*(C1-C8)+ (C2>C9)*(C2-C9)+ (C3>C10)*(C3-C10)+ (C4>C11)*(C4-C11)+ (C5>C12)*(C5-C12)) /((C<C7)*(C-C7)+ (C1<C8)*(C1-C8)+ (C2<C9)*(C2-C9)+ (C3<C10)*(C3-C10)+ (C4<C11)*(C4-C11)+ (C5<C12)*(C5-C12)+0.00001))-50
as Custom Indicators and be sure to check "Center Zero Line". Zoom out far enough so that you see flat parts at the bottom of both corves. This will ensure that both are plotted to the same scale. The center of the plot is the 50 line. As you can see, there is very little resemblance, especially in the top half of the plots.
Now, why does the plot you have not match the plot of PCF 2? My guess is that you have some type of moving average in your plot not present in PCF 2. Now, please change that x = 7 parameter to x = 1 in your plot without any other changes. Your plot should be RSI. Is your plot now identical to the TC2005 plot of Wilder's RSI with RSI Period = 6 and Avg Period = 1? If not, we need to solve that problem first.
When you change the x = 7 to x = 1 in PCF 1 and PCF 2, PCF2 will become RSI, except for the -50; PCF 1 will not.
One possibility is that your plot may have Wilder Smoothing on the "ups" and "downs". The two PCF's do not.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
The only MetaStock code for RMI I have found is:
Relative Momentum Index Q:=Input("RSI Time Periods",1,1000,14); M:=Input("Momentum Time Periods",1,1000,5); B:=Input("Field: 1=Close, 2=Open, 3=High, 4=Low, 5=Volume",1,5,1); Bval:=If(B=1,C,If(B=2,O,If(B=3,H,If(B=4,L,V)))); Mom:=Bval-Ref(Bval,-M);
Z:=Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(Q));
Y:=Wilders(If(ROC(Mom,1,$)<0, Abs(ROC(Mom,1,$)),0),LastValue(Q));
RMS:=Z/Y; RMIcust:=100-(100/(1+RMS)); Mov(RMIcust,M,S)
According to this:
Z = XAVG((C0-CM>C1-C(M+1))*(C1-C(M+1)-C0+CM),2*Q-1)
Y = XAVG((C0-CM<C1-C(M+1))*(C0-CM-C1+C(M+1))),2*Q-1)
The RMI is then:
100*(1-1/(1+Z/Y))
The two XAVG's have to be written as series requiring approximately 5*(2*Q-1) terms each. In case Q = 6 as above, this is 55 terms each. Bruce does this all the time, but I do not.
The code is an RSI with Wilder Smoothing where the RSI is placed on C-CM rather than on C. For this code, changing the M to 1 does not reduce the result to RSI (with Wilder Smoothing}. The code given here does not agree with any any description I have seen including the one given above by Gordon.
In any case, writing the PCF is a trivial matter even for me without the Wilder Smoothing and for Bruce with it.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
I do not know MetaStock code. Q is input as "RSI Time Periods". Although LastValue(Q) looks like the value of some array in
Wilders(If(ROC(Mom,1,$)>0, ROC(Mom,1,$),0),LastValue(Q))
I took it to be the Wilder Smoothing Period Q itself.
Maybe someone knowledgable in the MetaStock Language can clarify.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Here is a sample of the most common code I have found for RMI.
Relative Momentum Index (RMI)
The Relative Momentum Index (RMI) is a variation on the Relative Strength Index (RSI). To determine up and down days, the RSI uses the close compared to the previous close. The RMI uses the close compared to the close n days ago. An RMI with a time period of 1 is equal to the RSI.
The Relative Momentum Index was developed by Roger Altman and was introduced in his article in the February, 1993 issue of Technical Analysis of Stocks & Commodities magazine.
Formula: If C > Cm then
up = C-Cm
dn = 0
else
up = 0
dn = Cm-C
upavg = (upavg*(n-1)+up)/n
dnavg = (dnavg*(n-1)+dn)/n
RMI = 100*upavg/(upavg+dnavg)
This is different than the MetaStock code previously given. It differs from the PCF I gave only in that Wilder Smoothing is used on the "up" and "dn".
Thanks, Jim Murphy
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
This is the exact calculation given in the article Excel spreadsheet.
Your stock close is in col.B
Using the parameters of 5 and 20:
C7= IF(B7>B2,B7-B2,0) D7= IF(B7<B2,ABS(B7-B2),0) E26=SUM(C7:C26) E27=E26-(E26/20)+C27 F26=SUM(D7:D26) F27=F26-(F26/20)+D27 G27=E27/F27 H27=100*(G27/(1+G27))
H27 IS RMI
Hope that helps
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
Thank you diceman.
I do not know how to read Excel code, but it appears to yield the same result as the program in the post above it. The only distinction is that the Excel code tells you how to initialize the filters (exactly as Wilder did) and the the code in the post above it does not. Notice that the two filter outputs for each of the two codes are not the same, but their ratios are.
The form of a PCF for the RMI of the two codes will be given assuming the Wilder Smoothing filters have been running sufficiently long.
Let RMI(m,n) be the RMI with m the momentum period and n the Wilder Smoothing Period. Then, the form is:
RMI(m,n) = 100*XAVG((C>Cm)*(Cm-C),2*n-1)/XAVG(ABS(C-Cm),2*n-1)
We have used the fact that Wilder Smoothing of period n is an EMA of period 2*n-1. It is a trivial matter to write a series expansion for the two EMAs. A little epsilon, say 0.000001, should be added to the denominator to prevent a divide by zero.
This may not agree with the RSI that Gordon is using, but it does agree with a preponderance of those I have seen. When m = 1, it reduces to RSI with Wilder Smoothing. The RSI of TC2005 does not use Wilder Smoothing. In conformity with TC2005, the PCF I gave in my 02/22/06 1:27:12 PM post is RMI(7,6) with an SMA6 replacing the Wilder Smoothing of Period 6.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
bustermu
This is an "english" explanation of some of the equations. (The others are obvious)
Remember your stock close is in column B in ascending order. (earliest date B1--- most recent B100 and so on)
C7= IF(B7>B2,B7-B2,0)----------- (if B7>B2 then B7-B2... if not then zero ) D7= IF(B7<B2,ABS(B7-B2),0)-----(if B7<B2 then ABS(B7-B2)... if not then zero)
E26=SUM(C7:C26)---------------- The sum of cells C7 thru C26 E27=E26-(E26/20)+C27 F26=SUM(D7:D26)---------------- The sum of cells D7 thru D26 F27=F26-(F26/20)+D27 G27=E27/F27 H27=100*(G27/(1+G27))
|
|
Registered User Joined: 1/1/2005 Posts: 2,645
|
diceman,
I had no problem understanding what you explained to begin with, others might. My only problem is, for example, I assume that:
C28=IF(B28>B23,B28-B23,0) D28=IF(B28<B23,ABS(B28-B23),0) E28=E27-(E27/20)+C28 F28=F27-(F27/20)+D28 G28=E28/F28 H28=100*(G28/(1+G28))
etc.
Otherwise, the code makes no sense as far as I can tell.
Thanks, Jim Murphy
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
Yes
You are correct.
Sometimes they write equations where they are convenient.
Once they are "dragged" downward it would match your
form.
Thanks
|
|
Guest-1 |