AlfyParticipant
Average
Good morning guys, im trying to create an indicator which shows when the low of the day on which the close was below the 21 day exponential moving average is broken. Ive created the code for when the low is broken on the day after the close under the moving average but was hoping someone could help me with the code for when for example the low of that day is not broken for a few days or so. Any help is much appreciated.
a=exponentialaverage [21]
if close [1] crosses under a and low<LOW[1] THEN
b=1
else
b=0
endif
return B coloured (255,0,0)
Try this:
a=exponentialaverage[21]
if close[1] crosses under a1[1] and low<LOW[1] THEN
b=1
else
b=0
endif
return B coloured(255,0,0)
That was for a break just after the crossover.
This is for a break no matter when after the crossover (an opposite crossover cancels prior signal):
ONCE a = 0
IF a = 0 THEN
a = close CROSSES UNDER exponentialaverage[21]
c = low
ENDIF
IF close CROSSES OVER exponentialaverage[21] THEN
a = 0
c = 0
ENDIF
b = 0
if a and low < c THEN
b=1
endif
return B coloured(255,0,0)
AlfyParticipant
Average
Wonderful, thanks so much