Lowestsince above 0

Hi

I want to find the lowest value of NPriceC1 without "0" according to NPriceC7

I use the below code but it didn't work

Lowestsince(ref(NPriceC7,-1) != NPriceC7, NPriceC1, 0)

Please let me know how to deal with it

Thank you so much

Question

Simply convert zero to large number.
BTW, you are looking into "future" if you set 3rd argument of LowestSince() function to zero (as you did).
If you want to look backward then set to 1 (which is default one).

NPriceC1_noZero = IIf(NPriceC1 > 0, NPriceC1, 1e10);
NPriceC1_low = LowestSince(NPriceC7 != Ref(NPriceC7,-1), NPriceC1_noZero, 1);

Plot(NPriceC1_low, "NPriceC1 LowestSince", colorRed );
2 Likes

Thank you for ur advice
It is a good tip for processing the next step