logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
rudolf  
#1 Posted : Thursday, March 2, 2006 3:03:19 PM(UTC)
rudolf

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/2/2006(UTC)
Posts: 9

Hello, I am an inexperimented metastock user. I have a concept in mind, but I don't know if it is actually feasible to program it :( . Being a non-native english speaker, I might have a hard time to explain it clearly, but I will try. Instead of looking for divergences between prices and RSI, I would like to look for divergences between a given stock Relative Strength Comparative (with the NYSE) and the RSI of this stock Relative Strength Comparative (I hope my English is understandable :D .) In other words, I would like to apply the RSI on the Relative Strength Comprative instead of applying it on prices. As for now, I do have a formula that works very well for divergences between the close and the rsi (14). I would like to know whether it would be feasible to make the necessary changes to the formula have got in order to incorporate my concept into it. I thank you for looking into my post. Below you will find the formula I have got (that was given to me): maxper:=Input("max number of periods",2,50,15); minper:=Input("min number of period",0,50,0); cbear:=Input("Condition bear (1=on, 0=off)", 0,1,0); cbull:=Input("Condition bull (1=on, 0=off)", 0,1,0); data:=C; indic:=RSI(C,14); condbear:=If(cbear=1,RSI(data,14)>65,1); condbull:=If(cbull=1,1,1); mxp:=HHV(data,maxper); imxp:=ValueWhen(1, data=mxp,indic); mxi:=HHV(indic,maxper); dmxp:=HHVBars(data,maxper); dmxi:=HHVBars(indic,maxper); mnp:=LLV(data,maxper); mni:=LLV(indic,maxper); imnp:=ValueWhen(1, data=mnp,indic); dmnp:=LLVBars(data,maxper); dmni:=LLVBars(indic,maxper); If(imnp>mni AND mnp=data AND Abs(dmnp-dmni)>=minper AND condbull=1,1,If(imxp<mxi AND mxp=data AND Abs(dmxp-dmxi)>=minper AND condbear=1,-1,0))
Jose  
#2 Posted : Friday, March 3, 2006 12:45:01 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Rudolf, the first thing I would do here is try to get to understand your RSI/price divergence formula. Giving variables meaningful names, and enabling the If(cbull=1,1,1) Bull condition, can result in something like this indicator: [code:1:14cef3a922] { User inputs } HiLoPds:=Input("HHV/LLV periods",3,260,15); minPds:=Input("Minimum Bull/Bear periods",0,260,0); bullSwitch:=Input("Bull condition filter: [1]On, [0]Off",0,1,0); bearSwitch:=Input("Bear condition filter: [1]On, [0]Off",0,1,0); { Data array } data:=C; { Indicator } indic:=RSI(data,14); { Enable/disable Bull/Bear switches } condBull:=If(bullSwitch,indic<35,1); condBear:=If(bearSwitch,indic>65,1); { Lowest data/indicator values } loData:=LLV(data,HiLoPds); loDataBars:=LLVBars(data,HiLoPds); loIndic:=LLV(indic,HiLoPds); loIndicBars:=LLVBars(indic,HiLoPds); loIndicVal:=ValueWhen(1,data=loData,indic); { Highest data/indicator values } hiData:=HHV(data,HiLoPds); hiDataBars:=HHVBars(data,HiLoPds); hiIndic:=HHV(indic,HiLoPds); hiIndicBars:=HHVBars(indic,HiLoPds); hiIndicVal:=ValueWhen(1,data=hiData,indic); { Bull condition } bull:=condBull AND loData=data AND loIndicVal>loIndic AND Abs(loDataBars-loIndicBars)>=minPds; { Bear condition } bear:=condBear AND hiData=data AND hiIndicVal<hiIndic AND Abs(hiDataBars-hiIndicBars)>=minPds; { Plot signals in own window } bull-bear [/code:1:14cef3a922] The next step would be to replace your price data array within the formula, with the Relative Strength Comparative of price/NYSE index: [code:1:14cef3a922] { User inputs } HiLoPds:=Input("HHV/LLV periods",3,260,15); minPds:=Input("Minimum Bull/Bear periods",0,260,0); bullSwitch:=Input("Bull condition filter: [1]On, [0]Off",0,1,0); bearSwitch:=Input("Bear condition filter: [1]On, [0]Off",0,1,0); { Data array } data:=Fml("URSC-US Chart vs NYSE"); { Indicator } indic:=RSI(data,14); { Enable/disable Bull/Bear switches } condBull:=If(bullSwitch,indic<35,1); condBear:=If(bearSwitch,indic>65,1); { Lowest data/indicator values } loData:=LLV(data,HiLoPds); loDataBars:=LLVBars(data,HiLoPds); loIndic:=LLV(indic,HiLoPds); loIndicBars:=LLVBars(indic,HiLoPds); loIndicVal:=ValueWhen(1,data=loData,indic); { Highest data/indicator values } hiData:=HHV(data,HiLoPds); hiDataBars:=HHVBars(data,HiLoPds); hiIndic:=HHV(indic,HiLoPds); hiIndicBars:=HHVBars(indic,HiLoPds); hiIndicVal:=ValueWhen(1,data=hiData,indic); { Bull condition } bull:=condBull AND loData=data AND loIndicVal>loIndic AND Abs(loDataBars-loIndicBars)>=minPds; { Bear condition } bear:=condBear AND hiData=data AND hiIndicVal<hiIndic AND Abs(hiDataBars-hiIndicBars)>=minPds; { Plot signals in own window } bull-bear [/code:1:14cef3a922] Unfortunately you will need the URSC tool-kit for the above indicator to work. RSC is a complex process to program correctly in MetaStock. jose '-)
rudolf  
#3 Posted : Friday, March 3, 2006 11:10:26 AM(UTC)
rudolf

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/2/2006(UTC)
Posts: 9

Thank you for your reply, Jose. Tell me if I am wrong, but from what I understand I can't use a RSC based RSI without a tool kit. Could you please confirm that you are absolutely certain that the concept I have in mind would work (for explorations) with the kit you suggest and the formula as you rewrote it?
rudolf  
#4 Posted : Friday, March 3, 2006 11:19:47 AM(UTC)
rudolf

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/2/2006(UTC)
Posts: 9

I will try to work with the RSI/price divergence formula that you wrote to see if it works the same as the one I had. With the help of the metastock user's manual I will try to understand your formula as well (during the weekend). I will let you know how it goes. Thank you again for your help.
Jose  
#5 Posted : Friday, March 3, 2006 11:49:33 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
rudolf wrote:
from what I understand I can't use a RSC based RSI without a tool kit.
You can, but it involves some tricky programming to get it right. This is the main reason I've put the URSC tool-kit together: constant requests from clients for a workable RSC.
rudolf wrote:
Could you please confirm that you are absolutely certain that the concept I have in mind would work (for explorations) with the kit you suggest and the formula as you rewrote it?
Yes, absolutely. Either version of your divergence formula together with the URSC reference, works just as intended - tested & verified at my end. Bear in mind that you will need to replace the user-input variables with plain variables for your exploration.
rudolf wrote:
I will try to work with the RSI/price divergence formula that you wrote to see if it works the same as the one I had.
Both versions plot exactly the same signals. You may also be interested in looking at MACDH Divergence for this purpose.
rudolf wrote:
With the help of the metastock user's manual I will try to understand your formula as well (during the weekend).
Good stuff. ;) "Inexperimented" - excellent new English word! :) jose '-)
rudolf  
#6 Posted : Friday, March 3, 2006 12:11:41 PM(UTC)
rudolf

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/2/2006(UTC)
Posts: 9

I don't know what you mean by "Bear in mind that you will need to replace the user-input variables with plain variables for your exploration". It sounds scarry to me #-o . If it is just a change of few things in your formula, could you take care of it for me? Otherwise, I confirm that both formula works the same. Since you are absolutely certain that your kit will make my concept useable I will purchase it, but before to do so I would really like to have this "user-input/plain variables" solved. I guess it is just a detail.
Jose  
#7 Posted : Friday, March 3, 2006 12:24:10 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
There is nothing scary about MetaStock. :) Exploration filter code: [code:1:4ecaf97cf0] { Exploration variables } HiLoPds:=15 {HHV/LLV periods} minPds:=0; {Minimum Bull/Bear periods} bullSwitch:=0; {Bull condition filter: [1]On, [0]Off} bearSwitch:=0; {Bear condition filter: [1]On, [0]Off} { Data array } data:=C; { Indicator } indic:=RSI(data,14); { Enable/disable Bull/Bear switches } condBull:=If(bullSwitch,indic<35,1); condBear:=If(bearSwitch,indic>65,1); { Lowest data/indicator values } loData:=LLV(data,HiLoPds); loDataBars:=LLVBars(data,HiLoPds); loIndic:=LLV(indic,HiLoPds); loIndicBars:=LLVBars(indic,HiLoPds); loIndicVal:=ValueWhen(1,data=loData,indic); { Highest data/indicator values } hiData:=HHV(data,HiLoPds); hiDataBars:=HHVBars(data,HiLoPds); hiIndic:=HHV(indic,HiLoPds); hiIndicBars:=HHVBars(indic,HiLoPds); hiIndicVal:=ValueWhen(1,data=hiData,indic); { Bull condition } bull:=condBull AND loData=data AND loIndicVal>loIndic AND Abs(loDataBars-loIndicBars)>=minPds; { Bear condition } bear:=condBear AND hiData=data AND hiIndicVal<hiIndic AND Abs(hiDataBars-hiIndicBars)>=minPds; { Signals } bull-bear [/code:1:4ecaf97cf0] jose '-)
sportrider  
#8 Posted : Saturday, March 4, 2006 5:23:59 AM(UTC)
sportrider

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/12/2005(UTC)
Posts: 141
Location: Brooklyn,NY

Jose, LOL...none get by you ...I found that pretty funny.Thanks for the laugh
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.