[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Coding help



PureBytes Links

Trading Reference Links

Well, this doesn't match the criteria specified in some cases.
In short, think of the up-trend condition. You may have rsi>level3 but
at some point earlier you might as well have rsi<level3. In this case
your indicator will still plot a +1, though the up-trend was stopped
the day that the rsi crossed (even for a day) below the level3. The
same goes for the case of the down-trend.

Regards,

mc

--- In equismetastock@xxxxxxxxxxxxxxx, Pete Lieber <plieber@xxx> wrote:
>
> 
> 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@xxx
> 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
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/