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

[EquisMetaStock Group] Re: Need help for creating MS indicator



PureBytes Links

Trading Reference Links

Tono,

We will need to make a couple of decisions inorder to translate the 
code. 

It appears to be based on a Linear regression angle oscillator. The 
closest match that I can think of is the metastock Linear regression 
slope oscillator. Next problem is their use of average price. This 
could be simply the close but it could also be a smoothed average of 
the close. We do know that the trend days are 5 so that is not a 
problem.

Basically so far we would have:
 
LinRegSlope(x,5); 

The rest of the code evaluates for a new high or low based on the 
oscillator position.

We are also given a value for excess but I don't see it used in the 
code.

Maybe if you can supply some more input we can get a bit further with 
the translation.

Preston



--- In equismetastock@xxxxxxxxxxxxxxx, Har tono <tonmdn@xxx> wrote:
>
> Dear all,
> 
> Could anyone please help me to translate two following
> programming code to metastock indicator formula so we
> get the indicators as shown in attached image :
> 
> New Highs/Lows (Indicator)
> ---------------------------------------------------
> Input: TrendDays(5), Excess(8);
> Variables: NewHigh(0), NewHighVal(0), NewLow(0),
> NewLowVal(0);
> if H>NewHighVal[1] then begin
> NewHighVal=H;
> NewHigh=NewHigh[1]+1;
> end
> else begin
> if LinearRegAngle(AvgPrice, TrendDays)<0 then begin
> NewHighVal=H;
> NewHigh=0;
> end
> else begin
> NewHighVal=NewHighVal[1];
> NewHigh=NewHigh[1];
> end;
> end;
> if L<NewLowVal[1] then begin
> NewLowVal=L;
> NewLow=NewLow[1]+1;
> end
> else begin
> if LinearRegAngle(AvgPrice, TrendDays)>0 then begin
> NewLowVal=L;
> NewLow=0;
> end
> else begin
> NewLowVal=NewLowVal[1];
> NewLow=NewLow[1];
> end;
> end;
> Plot1(NewHigh,"New Highs");
> Plot2(-NewLow,"New Lows");
> Plot3(Excess,"OverB");
> Plot4(-Excess,"OverS");
> IF CheckAlert Then Begin
> IF Plot1 >= Plot3 then Alert("Overbought");
> IF Plot2 <= Plot4 then Alert("Oversold");
> IF Plot1 < Plot1[1] then Alert("Reset Count");
> IF Plot2 > Plot2[1] then Alert("Reset Count");
> End;
> ---------------------------------------------------
> 
> CandlelineRecord (Indicator)
> ---------------------------------------------------
> Variables: Lng(0),Supprt(c), Resistnce(c);
> Lng=Volatility(8);
> if Lng <= AbsValue(O - C) then begin
> if C>O then
> Supprt=(O+C)/2
> else
> supprt=supprt[1];
> if C<O then
> Resistnce=(O+C)/2
> else
> Resistnce=Resistnce[1];
> end;
> Plot1(Supprt,"Support");
> Plot2(Resistnce,"Resistance");
> ---------------------------------------------------
> 
> Appreciate the help very much
> 
> Thanks in advance
> 
> Tono
> 
> 
>       
______________________________________________________________________
______________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> 
> [Non-text portions of this message have been removed]
>



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

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/