Hi Folks,
I'm trying to add code so that I can adjust the Input Count for the bullstop and bearstop. What I came up with is not working. Any assistance would be very much appreciated!
def bullish2 = if signal > 0 and signal[1] <= 0 then barNumber() else 0;
plot upArrow = if !displayBubblesOnly and barNumber() == HighestAll(bullish2) then low * 0.994 else Double.NaN;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upArrow.SetLineWeight(5);
upArrow.SetDefaultColor(Color.CYAN);
def bearish2 = if signal < 0 and signal[1] >= 0 then barNumber() else 0;
plot downArrow = if !displayBubblesOnly and barNumber() == HighestAll(bearish2) then high * 1.004 else Double.NaN;
downArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
downArrow.SetLineWeight(5);
downArrow.SetDefaultColor(Color.YELLOW);
def bullstop= if barNumber() == HighestAll(bullish2) then low[1] else if barnumber() < HighestAll(bullish2) then double.nan else bullstop[1];
plot bullstopplot = bullstop;
bullstopplot.setdefaultColor(color.dark_green);
AddChartBubble(displayBubblesOnly and barNumber() == HighestAll(bullish2), low[1], "Stop " + astext(low[1]), Color.Dark_Green, no);
def bearstop= if barNumber() == HighestAll(bearish2) then high[1] else if barnumber() < HighestAll(bearish2) then double.nan else bearstop[1];
plot bearstopplot = bearstop;
bearstopplot.setdefaultColor(color.red);
AddChartBubble(displayBubblesOnly and barNumber() == HighestAll(bearish2), high[1], "Stop " + astext(high[1]), Color.red, yes);
Here's what I came up with but I'm getting errors and it does not work:
Input Count = 1;
def cond = bullstop or bearstop;
def dataCount = CompoundValue(1, if (cond) then dataCount[1] + 1 else dataCount[1], 0);
def limitplot = HighestAll(dataCount) - dataCount <= Count - 1;
I'm trying to add code so that I can adjust the Input Count for the bullstop and bearstop. What I came up with is not working. Any assistance would be very much appreciated!
def bullish2 = if signal > 0 and signal[1] <= 0 then barNumber() else 0;
plot upArrow = if !displayBubblesOnly and barNumber() == HighestAll(bullish2) then low * 0.994 else Double.NaN;
upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
upArrow.SetLineWeight(5);
upArrow.SetDefaultColor(Color.CYAN);
def bearish2 = if signal < 0 and signal[1] >= 0 then barNumber() else 0;
plot downArrow = if !displayBubblesOnly and barNumber() == HighestAll(bearish2) then high * 1.004 else Double.NaN;
downArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
downArrow.SetLineWeight(5);
downArrow.SetDefaultColor(Color.YELLOW);
def bullstop= if barNumber() == HighestAll(bullish2) then low[1] else if barnumber() < HighestAll(bullish2) then double.nan else bullstop[1];
plot bullstopplot = bullstop;
bullstopplot.setdefaultColor(color.dark_green);
AddChartBubble(displayBubblesOnly and barNumber() == HighestAll(bullish2), low[1], "Stop " + astext(low[1]), Color.Dark_Green, no);
def bearstop= if barNumber() == HighestAll(bearish2) then high[1] else if barnumber() < HighestAll(bearish2) then double.nan else bearstop[1];
plot bearstopplot = bearstop;
bearstopplot.setdefaultColor(color.red);
AddChartBubble(displayBubblesOnly and barNumber() == HighestAll(bearish2), high[1], "Stop " + astext(high[1]), Color.red, yes);
Here's what I came up with but I'm getting errors and it does not work:
Input Count = 1;
def cond = bullstop or bearstop;
def dataCount = CompoundValue(1, if (cond) then dataCount[1] + 1 else dataCount[1], 0);
def limitplot = HighestAll(dataCount) - dataCount <= Count - 1;