I have an indicator, and I want to get the MIN and MAX price values for each interval when the indicator is < 0.
Something like that:
If (my indicator[1] > 0 AND my indicator[0] < 0)
take this bar as StartDate
If (my indicator[1] < 0 AND my indicator[0] > 0)
take this bar as EndDate
Min = MIN(StartDate, EndDate)
Max = MAX(StartDate, EndDate)
Can you please help me with the code?
I'm not sure how to take the StartDate and EndDate bars.
Thank you
Comment