CKWParticipant
Veteran
Hi,
anyone can advise how to code second lowest low from the last 5 bars ? 🙂
thanks
br,
CKW
SecondLow = 999999
LookBack = 5
ll = lowest[LookBack](low)
FOR i = 0 to (LookBack - 1)
IF low[i] > ll THEN
SecondLow = min(SecondLow,low[i])
ENDIF
NEXT
There you go.
CKWParticipant
Veteran
thanks robertogozzi. It works !
thanks Grahal
Hi Roderto could l use the coding that you used to find Second low 5 bars, l want to find my highest close in the last 13 bars
Try this:
SecondHigh = 0
LookBack = 13
hh = highest[LookBack](high)
FOR i = 0 to (LookBack - 1)
IF high[i] < hh THEN
SecondHigh = max(SecondHigh,high[i])
ENDIF
NEXT
That’s much simpler:
MyHighestClose = highest[13](close)
I scan read (again!) and assumed the request was for a second highest close as this topic is about finding the second lowest close and not the lowest!
icharttop – if you want the highest close then use Roberto’s code but if you want the second highest then use mine! 🙂