//version=5
indicator("Chicho, BOS, Order Block & FBG", overlay=true)

// Función para detectar mínimos y máximos locales (Chicho)
lookback = 5
chichoLow = ta.lowest(close, lookback) == close
chichoHigh = ta.highest(close, lookback) == close

plotshape(chichoLow, title="Chicho Low", location=location.belowbar, color=color.green, style=shape.labeldown, text="Chicho Low")
plotshape(chichoHigh, title="Chicho High", location=location.abovebar, color=color.red, style=shape.labelup, text="Chicho High")

// Función para detectar Break of Structure (BOS)
var line bosLine = na
bosDetected = false
if (chichoHigh[1] and close < low[1])
bosDetected := true
bosLine := line.new(x1=bar_index[1], y1=high[1], x2=bar_index, y2=high[1], color=color.red, width=2, extend=extend.right)
if (chichoLow[1] and close > high[1])
bosDetected := true
bosLine := line.new(x1=bar_index[1], y1=low[1], x2=bar_index, y2=low[1], color=color.green, width=2, extend=extend.right)

// Función para detectar Order Block
var line orderBlockLine = na
orderBlockDetected = false
orderBlockColor = close > open ? color.green : color.red
if (bosDetected)
orderBlockDetected := true
orderBlockLine := line.new(x1=bar_index, y1=close, x2=bar_index+10, y2=close, color=orderBlockColor, width=2, extend=extend.right)

// Función para detectar Fair Value Gap (FBG)
var box fbgBox = na
fbgDetected = close[2] < low[1] and high[2] > high[1] // Ejemplo básico de FBG
if (fbgDetected)
fbgBox := box.new(left=bar_index[2], top=high[2], right=bar_index, bottom=low[2], color=color.blue, opacity=50)
Wave Analysis

Pernyataan Penyangkalan