tpaintingstrategy(paintingstrategy.boolean_points) ītpaintingstrategy(paintingstrategy.boolean_points) ĭefineglobalcolor('bullish', color.uptick) ĭefineglobalcolor('neutral', ay) ĭefineglobalcolor('bearish', color.downtick) Īssignpricecolor(if !paintbars then color.current else if greenprice then globalcolor('bullish') else if redprice then globalcolor('bearish') else globalcolor('neutral')) Shareable Link Plot neutral = !greenprice and !redprice ītpaintingstrategy(paintingstrategy.boolean_points)
Input aggregationperiod = aggregationperiod.day ĭef new_high = close > highest(high(period = aggregationperiod), trail) ĭef new_low = close < lowest(low(period = aggregationperiod), trail) ĭef greenprice = if new_high then yes else if new_low then no else new_high ĭef redprice = if new_low then yes else if new_high then no else new_low