From Tradestation code to Metastock code

ciuka

New Member
#1
Hello, I have found this Tradestation indicator. It's an interesting moving average. Can some of you translate into a metastock code? I hope so. Thank you.

Inputs:
LookBack(20);
Variable:
PercChange(0),
NewLevel(0),
AvgPercChange(0);

PercChange = (Close - Close[1])/Close[1];
AvgPercChange = Average(PercChange,20);
NewLevel = Close * (1 + AvgPercChange);
Plot1[1](NewLevel,"");
 
#2
her's looking at you
LookBack:20;
PercChange:= (Close - Ref(Close,-1))/Ref(Close,-1);
AvgPercChange:= Average(PercChange,20);
NewLevel:= Close * (1 + AvgPercChange);
NewLevel
 
#3
Couple of errors above
LookBack:=20;
PercChange:= (CLOSE - Ref(CLOSE,-1))/Ref(CLOSE,-1);
AvgPercChange:=Mov(PercChange,20,S);
NewLevel:= CLOSE * (1 + AvgPercChange);
NewLevel
Sorry
 

Similar threads