PureBytes Links
Trading Reference Links
|
Can someone convert these TWO indicators it is in tradestation code to metastock code. It is a pretty good indicator I think. Thanks. KS Omega TradeStation. =================================== {Percentage Trend Indicator with correction filter and dynamic period of trend calculation}
Inputs: K(15), {%Coeff. of correction} Max_per(50); {Max. Dynamic Period for Trend Calculation} Vars: Trend(C), Period(0) ; {Trend Calculation} Condition1= C > Trend[1]; {UpTrend} Condition2= C <= Trend[1]; { DownTrend} {SetUp Period When New Trend Begin} If C Cross over Trend[1] or C Cross Below Trend[1] Then Period = 0; If Period < Max_per Then Begin {Counting UpTrends with dynamic period} If Condition1 Then Begin Period = Period +1; Trend = Highest(C,Period)[1]∗(1 — (K/100)); End ;
{Counting DownTrends with dynamic period} If Condition2 Then Begin Period = Period + 1; Trend = Lowest(C,Period)[1]∗(1 + (K/100)); End; End Else Begin {Counting UpTrends with constant period} If Condition1 Then Trend = Highest(C,Max_per)[1]∗(1 — (K/100)); {Counting DownTrends with constant period} If Condition2 Then Trend = Lowest(C,Max_per)[1]∗(1 + (K/100)); End; {Plotting Indicator} Plot1(Trend, «Trend»); ======================================
Omega TradeStation. {Volatility Trend Indicator based on Smoothed True Range and dynamic period of trend calculation} Inputs: Len(21), {WATR Lenght} M(3), {WATR Multiplier} Max_per(50); {Max. Dynamic Period for Trend Calculation} Vars: TrueHi(H), TrueLo(L), TrueRng(0), WATR(0), Trend(C), Period (0) ; {Calculate Smoothed TR} If Close[1] > High Then TrueHi = Close[1] Else TrueHi = High; {Calculate TrueHigh} If Close[1] < Low Then
TrueLo = Close[1] Else TrueLo = Low; {Calculate TrueLow} TrueRng = TrueHi — TrueLo; {Calculate TrueRange} WATR = WAverage(TrueRng,Len); {Calculate WATR} {Trend Calculation} Condition1= C > Trend[1]; {UpTrend} Condition2= C <= Trend[1]; { DownTrend} {SetUp Period When New Trend Begin} If C Cross over Trend[1] or C Cross Below Trend[1] Then Period = 0; If Period < Max_per Then Begin {Counting UpTrends with dynamic period} If Condition1 Then Begin Period = Period +1; Trend = Highest(C,Period) — M∗WATR; End ; {Counting DownTrends with dynamic period} If Condition2 Then Begin Period = Period + 1; Trend = Lowest(C,Period) + M∗WATR; End; End Else Begin {Counting UpTrends with constant period} If Condition1 Then Trend = Highest(C,Max_Per)[1] — M∗WATR; {Counting DownTrends with constant period} If Condition2 Then Trend = Lowest(C,Max_per)[1] + M∗WATR; End; {Plotting
Indicator} Plot1(Trend,»Trend»);
========================================
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|