Ich Versuche folgende Formel aus Metastock in Investox umzusetzen:
Der Knackpunkt ist die
Metastock Funktion Prev welche ich in Investox versucht habe durch das Statement Ref(AMA, -1) zu ersetzen.
Leider Funktioniert es nicht.
Kennt sich hier jemand aus?
Beschreibung zu PREV (Self-Referencing Formula Calculations):
You are using the PREV variable in a location within a custom indicator that will cause the calculation to be very slow. You should normally try to avoid using the PREV variable as a DATA ARRAY when there is also a PERIODS specified (e.g., mov(prev, 20, s), hhv(prev, 30), etc.). Although use of the PREV function in this way is allowable, it will take a long time to calculate, particularly if a lot of data is loaded in the chart.
Orginal:
AMA:=If(Cum(1)=5,Ref(C,-1)+(Pwr((Abs((C-Ref(C,-4))/Sum(Abs(ROC(C,1,$)),4)))*((2/3)-(2/31))+(2/31),2))*(C-Ref(C,-1)),PREV+(Pwr((Abs((C-Ref(C,-4))/Sum(Abs(ROC(C,1,$)),4)))*((2/3)-(2/31))+(2/31),2))*(C-PREV));
a:=AMA>Ref(AMA,-1);
b:=AMA<Ref(AMA,-1);
state:=If(BarsSince(a)<BarsSince(b),1,0);
state>Ref(state,-1)
Investox:
Calc AMA: (If(CUM(1)=5,Ref(Close, -1)+(Power((Abs((Close-Ref(Close,-4))/SUM(ABS(ROC(Close, 1, $)), 4)))*((2/3)-(2/31))+(2/31),2))*(Close-Ref(Close,-1)),Ref(AMA, -1)+(Power((ABS((Close-Ref(Close,-4))/SUM(ABS(ROC(Close,1,$)), 4)))*((2/3)-(2/31))+(2/31), 2))*(Close-Ref(AMA, -1))));
Calc a: AMA>Ref(AMA,-1);
Calc b: AMA<Ref(AMA,-1);
Calc state: If(BarsSince(a)<BarsSince(b),1,0);
state>Ref(state,-1)