Down below is the latest version “Crazy Oleg’s Bouncing Boners”

The indicator works like this:

  • Waits for x number of Heikin ashi candles to occur in 1 direction.

  • On heikin color flip, a “boner” appears suggesting it’s safe to get into a trade.

Suggested entry/exits:

  • Set your stop loss under the candle before the boner.

  • Exit when color of heikin candle changes.

Works pretty good, but better if your moving averages are trending and you’re taking a pullback/continuation trade.

Indicator includes inputs for moving averages and the number of consecutive bars for the heikin ashi.

Code appears below.. but remember, Oleg not financial advice. Oleg major head injury very low iq 72. 😉

//@version=6
indicator("Crazy Oleg's Heikin Ashi Bouncing Boners ", overlay=true, max_labels_count = 500)

// --- Colors ---
c_green_signal = #089981
c_red_signal   = #E91E63
c_grey         = color.gray

// --- Moving Average Inputs ---
group_ma = "Moving Averages (Visual Only)"
ma_type  = input.string("EMA", "Global MA Type", options=["EMA", "HMA"], group=group_ma)
ma1_len  = input.int(20, "Fast MA Length", minval=1, group=group_ma)
ma2_len  = input.int(50, "Medium MA Length", minval=1, group=group_ma)
ma3_len  = input.int(200, "Slow MA Length", minval=1, group=group_ma)

// --- HA Threshold Inputs ---
group_boner    = "Heikin Ashi Signal Settings"
thrustCountReq = input.int(4, "Consecutive HA Bars (n)", minval=1, group=group_boner)
iconSize       = input.string(size.small, "Icon Size", options = [size.tiny, size.small, size.normal, size.large], group=group_boner)

// --- VWAP Inputs ---
group_vwap = "VWAP Settings (Visual Only)"
anchor    = input.string("Session", "Anchor Period", options=["Session", "Week", "Month", "Quarter", "Year"], group=group_vwap)
src_vwap  = input.source(hlc3, "VWAP Source", group=group_vwap)
calcModeInput = input.string("Standard Deviation", "Bands Calculation Mode", options = ["Standard Deviation", "Percentage"], group = "VWAP Bands Settings")
bandMult_2 = input.float(2.0, "Extension Threshold (Band 2)", group = "VWAP Bands Settings", step = 0.5)

// --- 1. Fetch Heikin Ashi Data ---
ha_ticker = ticker.heikinashi(syminfo.tickerid)
ha_open   = request.security(ha_ticker, timeframe.period, open)
ha_close  = request.security(ha_ticker, timeframe.period, close)

// --- 2. HA Climax Logic (The "Boner" Threshold) ---
isHA_Bull = ha_close > ha_open
isHA_Bear = ha_close < ha_open

var int ha_bullBars = 0
var int ha_bearBars = 0
ha_bullBars := isHA_Bull ? ha_bullBars + 1 : 0
ha_bearBars := isHA_Bear ? ha_bearBars + 1 : 0

// Track if the threshold was met (Waiting for color flip)
var bool thresholdMetLong  = false
var bool thresholdMetShort = false

if ha_bearBars >= thrustCountReq
    thresholdMetLong := true
if ha_bullBars >= thrustCountReq
    thresholdMetShort := true

// --- 3. Entry Trigger Logic (Color Change) ---
bool triggerLong  = thresholdMetLong and isHA_Bull
bool triggerShort = thresholdMetShort and isHA_Bear

if triggerLong
    thresholdMetLong := false
if triggerShort
    thresholdMetShort := false

// --- 4. Plotting "Boner" Icons ---
atr_val = ta.atr(14)

if triggerLong
    label.new(bar_index, low - (atr_val * 0.75), text="●   ●", color=color.new(c_green_signal, 100), textcolor=c_green_signal, style=label.style_label_up, size=iconSize)
    label.new(bar_index, low - (atr_val * 0.75), text="", color=c_green_signal, style=label.style_arrowup, size=iconSize)
    
if triggerShort
    label.new(bar_index, high + (atr_val * 0.75), text="●   ●", color=color.new(c_red_signal, 100), textcolor=c_red_signal, style=label.style_label_down, size=iconSize)
    label.new(bar_index, high + (atr_val * 0.75), text="", color=c_red_signal, style=label.style_arrowdown, size=iconSize)

// --- Visual Aids: MAs (Hidden by Default) & VWAP ---
get_ma(len) => ma_type == "EMA" ? ta.ema(close, len) : ta.hma(close, len)

// display.none keeps them in the code/settings but hides them on start
plot(get_ma(ma1_len), color=color.yellow, title="Fast MA", display=display.none)
plot(get_ma(ma2_len), color=color.blue,   title="Med MA",  display=display.none)
plot(get_ma(ma3_len), color=color.purple, title="Slow MA", display=display.none, linewidth=2)

isNewPeriod = timeframe.change(anchor == "Session" ? "D" : anchor == "Week" ? "W" : anchor == "Month" ? "M" : anchor == "Quarter" ? "3M" : "12M")
[_vwap, _stdevUpper, _] = ta.vwap(src_vwap, isNewPeriod, 1)
stdevAbs = _stdevUpper - _vwap
bandBasis = calcModeInput == "Standard Deviation" ? stdevAbs : _vwap * 0.01
upper2 = _vwap + bandBasis * bandMult_2
lower2 = _vwap - bandBasis * bandMult_2

plot(_vwap, title="VWAP", color=color.white, linewidth=2)
plot(upper2, color=color.new(c_grey, 50), title="VWAP U2")
plot(lower2, color=color.new(c_grey, 50), title="VWAP L2")

// --- Unified Alerts ---
if triggerLong
    alert("HA Long Color Flip Triggered!", alert.freq_once_per_bar_close)
if triggerShort
    alert("HA Short Color Flip Triggered!", alert.freq_once_per_bar_close)

// --- Dashboard ---
var table ryan_table = table.new(position.top_right, 2, 2, bgcolor=color.new(color.black, 40), border_width=1, border_color=color.gray)
if barstate.islast
    table.cell(ryan_table, 0, 0, "Long Climax Active?", text_color=color.white)
    table.cell(ryan_table, 1, 0, thresholdMetLong ? "YES" : "NO", bgcolor=thresholdMetLong ? color.new(c_green_signal, 50) : na)
    table.cell(ryan_table, 0, 1, "Short Climax Active?", text_color=color.white)
    table.cell(ryan_table, 1, 1, thresholdMetShort ? "YES" : "NO", bgcolor=thresholdMetShort ? color.new(c_red_signal, 50) : na)

Reply

Avatar

or to participate

Keep Reading