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

Re: TradStation versus MetaStock functions



PureBytes Links

Trading Reference Links

Gary,

A fellow SI and MSList participant, Jan Wolansky, extracted this formula
from the Equis support team after a similar request last October and
shared it with me.  I don't have any hands on experience with TS, but
you might test this one to see if it approximates the TS decimal values
you're after.  If not, at least it might provide a starting point for
further experimentation.

Craig


{ADX-decimal}

Periods:=Input("Time Periods",1,100,14);

PlusDM:=If(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),If(H>Ref(H,-1) AND
L<Ref(L,-1) AND 
H-Ref(H,-1)>Ref(L,-1)-L, H-Ref(H,-1),0));
PlusDI:=100*Wilders(PlusDM,Periods)/ATR(Periods);

MinusDM:=If(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,If(H>Ref(H,-1) AND
L<Ref(L,-1) AND 
H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0));
MinusDI:=100*Wilders(MinusDM,Periods)/ATR(Periods) ;

DIDif:=Abs(PlusDI-MinusDI);
DISum:=PlusDI+MinusDI;
ADXFinal:=100*Wilders(DIDif/DISum,Periods);
ADXFinal 



Randall_Gary@xxxxxxxx wrote:
> 
>      I'm converting some TradeStation code to MetaStock.  In comparing
>      results I've found that some functions don't return the same results.
> 
>      For instance, MetaStock's ATR(45) function seems to return the
>      correctly smoothed results according to Wilder's book, but
>      TradeStation's AveTrueRange(45) doesn't.  It actually returns the
>      simple moving average of TrueRange, the MetaStock equivalent of
>      mov(ATR(1),45,S).
> 
>      The TradeStation ADX(14) doesn't compare well at all to MetaStock's
>      version.  While MetaStock returns rounded integer values as Wilder
>      said, TradeStation returns fractional values which can't round to the
>      MetaStock values.
> 
>      Does anyone know how to simulate TradeStation's ADX results in
>      MetaStock?  I need to duplicate TradeStation's results in order to
>      achieve the same results as the TradeStation system.
> 
>      Gary Randall -- Brunswick, Maine