Formula discriptions

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

Formula discriptions

Post by henry1224 »

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
Chris White
Posts: 211
Joined: Mon Nov 29, 2010 9:21 pm

Re: Formula discriptions

Post by Chris White »

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.
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

Re: Formula discriptions

Post by henry1224 »

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
Post Reply