Hello Chris,
Could you please provide a brief description of the following Formulas.
1: BarsCount
2: BarsSince with Reset
3: Backset
4: Convert NaN 2 Prev
Thanks
Henry
Formula discriptions
Moderator: Chris White
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: Formula discriptions
BarsCount: Returns the bar number starting at 0 and incrementing by 1 each bar to the end of the data.
Useful for counting the number of bars between events.
Eg:
VALUEWHEN(BARSCOUNT(C), event1) - VALUEWHEN(BARSCOUNT(C), event2);
BarsSinceWithReset(Cond, Reset):
Returns the number of bars since the condition was true, resetting the count when Reset is true;
Backset(Cond, Data, N): Returns N bars from Data when condition is true;
ConvertNanToPrev(Data): IF the data series has NaN values, replaces them with the last known value so as to maintain a continues set of data.
Useful for counting the number of bars between events.
Eg:
VALUEWHEN(BARSCOUNT(C), event1) - VALUEWHEN(BARSCOUNT(C), event2);
BarsSinceWithReset(Cond, Reset):
Returns the number of bars since the condition was true, resetting the count when Reset is true;
Backset(Cond, Data, N): Returns N bars from Data when condition is true;
ConvertNanToPrev(Data): IF the data series has NaN values, replaces them with the last known value so as to maintain a continues set of data.
Re: Formula discriptions
Hello Chris, thanks for the descriptions.
If I want to get the previous value of a variable using convertNan2Prev, I would have to make the variable end with a nan condition?
A:=If (C>Ref(C,1),C-Ref(C,1),Nan);
A1:ConvertNan2Prev(A);
Sum(A+A1,5);
Is that correct?
Henry
If I want to get the previous value of a variable using convertNan2Prev, I would have to make the variable end with a nan condition?
A:=If (C>Ref(C,1),C-Ref(C,1),Nan);
A1:ConvertNan2Prev(A);
Sum(A+A1,5);
Is that correct?
Henry