AlfyParticipant
Average
Hi guys, im looking to create an indicator that shows when a stock has had 12 or more “up days” out of the last 15 with an “up day” defined as close to previous close. Can anyone help?
Best regards
There you go (not tested):
Distance = 3 * PipSize //distance to consider a price close to another one
IsClose = ((close <= (close[1] + Distance)) and ((close >= (close[1] - Distance))
Cond = (summation[15](IsClose) >= 12)
Return Cond
Change DISTANCE to set the desired distance.
a = summation[15](close > close[1]) >= 12
return a
AlfyParticipant
Average
Thanks so much to you both