Chicago Illinois USA
Posts: 1 since Feb 2018
Thanks Given: 0
Thanks Received: 0
|
Trying to convert PolychMTN from Thinkorswim into tradestation. I used the August 8th post as the formula. Tradestation and TOS don't match. Below is the formula used for Tradestation. Does anyone have the same problem? I use this momentum indicator on stocks and want to use tradestation instead of TOS. I would like to have the readings match.
Inputs:
price ( Close),
length ( 8);
Variables:
num ( 0 ),
indexN ( 0 ),
accuN ( 0 ),
denom ( 0 ),
indexD ( 0 ),
accuD ( 0 ),
offset ( 0 );
accuN = 0;
for indexN = 1 to length+1 begin
if indexN > length then offset = length else offset = indexN;
accuN = accuN + (price - price[offset]) / SquareRoot(indexN);
end;
num = accuN;
accuD = 0;
for indexD = 1 to length+1 begin
accuD = accuD + SquareRoot(indexD);
end;
denom = accuD;
Plot1( num/Denom, "Momentum" );
plot2(.2,"sxo",Red);
Plot3(-.04,"Bxo",Cyan);
|