AllDates = DateNum();
Price0
= ValueWhen(Nmnth1,Price,1);
Price1
= ValueWhen(Nmnth1,Price,2);
MnGain
= 100 * (Price0 -
Price1)/Price1;
Per1
= BarsSince(AllDates ==
StartDate);
MnGainH
= HHV(MnGain,Per1);
MnGainL
= LLV(MnGain,Per1);
AddColumn(MnGain,"MnGain",1.2);
AddColumn(MnGainH,"Highest
MnGain",1.2,colorDefault, Col, 120);
AddColumn(MnGainL,"Lowest
MnGain",1.2,colorDefault,
Col, 120);
When I run this, I get proper
results in the McGainH column and blanks in the McGainL
column.
What detail am I missing in
this?
I have tried this line
substituted,
MnGainL =
IIf(MnGain<0,LLV(MnGain,Per1),LLV(MnGain,25));
And I get values where MnGain
is > 0 and where the Period is a fixed 25 instead of the Per1, and blank
values where MnGain is < 0.
It seems that LLV does not like
the Per1 value for the period but the HHV function works OK with Per1 as the
Period. Why?
Must be basic but can someone
educate me on this simple problem?
Thanks,
Ken