appplejack003
New member
Hi guys,
I'm trying to create an indicator that meets the following criteria but so far it hasn't worked.
Conditions:
1.Current close must be higher than the high of the previous bar.
2.Current close must be higher than the high of any of the last 3 bars.
3.Paint an arrow when these conditions are met.
Nothing happens on my chart and I don't know why.
Here is the code below:
#Declare variables
declare lower;
input numBars = 3;
#Define conditions
def currClose = close;
def prevHigh = high[1];
def pastHigh = highest(high, numBars);
#Paint arrow when conditions are met
plot arrowUp = if currClose > prevHigh and currClose > pastHigh then low - 1 else double.nan;
arrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrowUp.SetDefaultColor(Color.GREEN);
arrowUp.SetLineWeight(2);
Thanks!
I'm trying to create an indicator that meets the following criteria but so far it hasn't worked.
Conditions:
1.Current close must be higher than the high of the previous bar.
2.Current close must be higher than the high of any of the last 3 bars.
3.Paint an arrow when these conditions are met.
Nothing happens on my chart and I don't know why.
Here is the code below:
#Declare variables
declare lower;
input numBars = 3;
#Define conditions
def currClose = close;
def prevHigh = high[1];
def pastHigh = highest(high, numBars);
#Paint arrow when conditions are met
plot arrowUp = if currClose > prevHigh and currClose > pastHigh then low - 1 else double.nan;
arrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
arrowUp.SetDefaultColor(Color.GREEN);
arrowUp.SetLineWeight(2);
Thanks!