question: do something IF current bar (or previous bar) is LLV

#1
Hi,

I would like to calculate the ratio between MinL and MaxH only if MinL is the current bar (or the one before).

MinL and MaxH are defined as follows.

MaxH = HHV(Mom, Len);
MinL = LLV(Mom, Len);

Mom is a lengthy formula defining momentum and Len = 5 bars

I tried IIF and If statements with the following syntax to compare but I cannot get it to work.

Would anybody have an idea on how to do that please?

Thanks a bunch
 

colion

Active Member
#2
LLV returns an array so try something like this (several ways to do this):

MinL = IIf( LastValue( L ) == LLV( Mom, Len ), 1, 0 );
 

Similar threads