I have an indicator to detect MACD Divergence in MetaStock that uses the code below. I cannot seem to find a way to calculate the "most recent" or "second most recent" LOW. Here's the code
{Gives the value of the most recent Price low}
LC:=LowestSince(1,X,LOW);
{Gives the value of the 2nd most recent Price low}
LP:=ValueWhen(2,x,Ref(LC,-1));
Any help would be greatly appreciated !!
Thank you,
Jim