PureBytes Links
Trading Reference Links
|
RSI Up Trend
periods:= Input("periods",2,200,9); level1:= Input("level1", 0,100,70); level2:= Input("level2", 0,100,30); level3:= Input("level3", 0,100,40);
If(BarsSince(RSI(periods)>level1) < BarsSince(RSI(periods)<level2) AND RSI(periods) > level3,1,0)
This indicator will = 1, whenever your Up Trend condition is met
Conversely, here is this indicator as a down trend
RSI Down Trend
periods:= Input("periods",2,200,9); level1:= Input("level1", 0,100,30); level2:= Input("level2", 0,100,70); level3:= Input("level3", 0,100,60);
If(BarsSince(RSI(periods)<level1) < BarsSince(RSI(periods)>level2) AND RSI(periods) <level3,-1,0)
To: equismetastock@xxxxxxxxxxxxxxx From: brett_j_sinclair@xxxxxxxxx Date: Fri, 6 Feb 2009 07:30:31 -0800 Subject: [EquisMetaStock Group] Coding help
I am hoping that someone can help me code the following in Metastock.
Up Trend
Using a 9 period RSI, the first step is to determine how many periods have passed since the RSI went above 70 and how many periods have passed since it went below 30.
If there have been fewer periods since it was above 70, then we check to see if the lowest value of RSI since that point is still above 40. If this is the case, then we have a confirmed up trend. It began when the RSI value first exceeded 70 and continues so long as the lowest RSI value stays above 40.
Down Trend
Using the same 9 period RSI, we determine how many periods have gone by since the RSI went above 70 and how many periods have passed since it went below 30.
If there have been fewer periods since it was below 30, then we check to see if the highest value of RSI since that point is still below 60. If this is the case then we have a confirmed down trend. It began when the RSI value first fell below 30 and continues so long as the highest RSI value stays below 60.
Trading Range
The trading range is simple to detect. We find it be default. When an up trend ends, but a down trend is not detected by the above criteria, a trading range has been established. Of course, the opposite is true too. When a down trend ends, but an uptrend does not show itself, a trading range has been established.
The indicator seems to work quite well using another software platform, but my choice is Metastock.
Thanks, Brett
|
__._,_.___
__,_._,___
|
|