OPEN-SOURCE SCRIPT

Camarilla Screener

//version=5
indicator("Camarilla Screener", overlay=false)

// Input for timeframe (Yearly or Monthly)
timeframe = input.timeframe("1M", "Timeframe for Analysis")

// Fetch high, low, and close of the selected timeframe
high_tf = request.security(syminfo.tickerid, timeframe, high)
low_tf = request.security(syminfo.tickerid, timeframe, low)
close_tf = request.security(syminfo.tickerid, timeframe, close)

// Calculate Camarilla levels
range_hl = high_tf - low_tf
S3 = close_tf - (range_hl * 1.1 / 4)
S4 = close_tf - (range_hl * 1.1 / 2)
S5 = close_tf - (range_hl * 1.1)

// Current month candle details
open_current = request.security(syminfo.tickerid, "1M", open)
close_current = request.security(syminfo.tickerid, "1M", close)
low_current = request.security(syminfo.tickerid, "1M", low)
high_current = request.security(syminfo.tickerid, "1M", high)

// Conditions
low_sweep = low_current < low_tf // Monthly low sweeps previous month's low
bullish_close = close_current > open_current // Bullish close
doji_condition = math.abs(close_current - open_current) < (0.005 * close_current) // Doji condition
cross_camarilla = high_current > S3 or high_current > S4 or high_current > S5 // Camarilla levels breached

// Combine all conditions
condition_met = low_sweep and bullish_close and doji_condition and cross_camarilla

// Plot signals
plotshape(condition_met, title="Signal", location=location.top, color=color.green, style=shape.labelup, text="Camarilla Setup")

// Display levels for reference
plot(S3, color=color.red, title="S3")
plot(S4, color=color.orange, title="S4")
plot(S5, color=color.yellow, title="S5")
educational

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?

Clause de non-responsabilité