BannonMan85
New member
Hello, is there a way to change the signal of this indicator from a color change into an arrow that can be scanned?
Code:
declare upper;
input changeCandleColor = yes;
input dojiBodyRatio = 0.05;
def hc = OHLC4;
def ho = CompoundValue(1, (ho[1] + hc[1]) / 2, hc);
def hh = Max(Max(high, ho), hc);
def hl = Min(Min(low, ho), hc);
def hRange = (hh-hl);
def doji_data = AbsValue(ho - hc) <= (hRange) * dojiBodyRatio;
def HAclose = ohlc4;
def HAopen = CompoundValue( 1, ( HAopen[1] + HAclose[1] ) / 2, HAclose );
def HAhigh = Max( high, Max( HAopen, HAclose ) );
def HAlow = Min( low, Min( HAopen, HAclose ) );
input testbubble = yes;
AddChartBubble(testbubble and HAopen == HAhigh, HAhigh, high, Color.YELLOW);
AddChartBubble(testbubble and HAopen == HAlow, HAlow, low, Color.WHITE, no);
DefineGlobalColor("H", Color.RED);
DefineGlobalColor("L", Color.MAGENTA);
input pricecolor = yes;
AssignPriceColor(if !pricecolor then Color.CURRENT
else if HAopen == HAhigh then GlobalColor("H")
else if HAopen == HAlow then GlobalColor("L")
else Color.YELLOW);
plot doji_green = if doji_data and (hc > ho) then 1 else Double.NaN;
doji_green.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
doji_green.SetDefaultColor(Color.WHITE);
plot doji_red = if doji_data and (ho > hc) then 1 else Double.NaN;
doji_red.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
doji_red.SetDefaultColor(Color.WHITE);
AssignPriceColor(if changeCandleColor and doji_data then Color.WHITE else Color.CURRENT);