OPEN-SOURCE SCRIPT
Camarilla Pivots + 20 EMA Strategy

This is an intraday volatility and trend-following system for commodities like Natural Gas, combining dynamic pivot levels (Camarilla) with a trend filter (20-period EMA) to improve risk-reward and reduce false breakouts.
Core Components
1. Camarilla Pivots:
These are special support and resistance levels (H3, H4, L3, L4) calculated each day based on the previous day's high, low, and close.
The pivots adapt to daily volatility, giving more relevant breakout and bounce zones than static lines.
H4: Aggressive resistance (used for breakout LONG entry)
H3: Moderate resistance/support (used for bounce or stoploss)
L4: Aggressive support (used for breakout SHORT entry)
L3: Moderate support/resistance (used for bounce or stoploss)
2. 20 EMA (Exponential Moving Average):
Plotted on the 30-minute chart, this acts as a trend filter.
If the price is above 20 EMA: Only look for long trades (bullish bias).
If below 20 EMA: Only look for short trades (bearish bias).
How the Strategy Works
Setup (30-Min Chart):
Camarilla pivots for the day are drawn on the chart.
20 EMA is also plotted.
Trade Filter:
Bullish: Trade ONLY if price is above 20 EMA.
Bearish: Trade ONLY if price is below 20 EMA.
Entry:
LONG: Enter when price breaks and closes above the H4 pivot AND is above 20 EMA.
SHORT: Enter when price breaks and closes below the L4 pivot AND is below 20 EMA.
Stop Loss:
LONG: Place stoploss at H3 (the next lower Camarilla resistance).
SHORT: Place stoploss at L3 (the next higher Camarilla support).
Target:
Always set a profit target at 2x the distance (risk) between entry and stoploss (strict R:R 2).
For example, if your entry is at H4 and stoploss at H3, your target is entry + 2*(entry - stoploss).
Alerts & Visuals:
The strategy plots entry arrows, stoploss and target lines for immediate visual reference.
Alerts trigger on breakout signals so you never miss a trade.
Why This Works Well for Natural Gas
Adapts to volatility: The pivots change daily, handling wide-ranging and choppy price moves better than fixed breakouts.
Trend filter: EMA prevents counter-trend whipsaws, only trades with market momentum.
Risk control: Every trade must meet strict risk-reward criteria, so losses are contained and winners can outweigh losers.
Core Components
1. Camarilla Pivots:
These are special support and resistance levels (H3, H4, L3, L4) calculated each day based on the previous day's high, low, and close.
The pivots adapt to daily volatility, giving more relevant breakout and bounce zones than static lines.
H4: Aggressive resistance (used for breakout LONG entry)
H3: Moderate resistance/support (used for bounce or stoploss)
L4: Aggressive support (used for breakout SHORT entry)
L3: Moderate support/resistance (used for bounce or stoploss)
2. 20 EMA (Exponential Moving Average):
Plotted on the 30-minute chart, this acts as a trend filter.
If the price is above 20 EMA: Only look for long trades (bullish bias).
If below 20 EMA: Only look for short trades (bearish bias).
How the Strategy Works
Setup (30-Min Chart):
Camarilla pivots for the day are drawn on the chart.
20 EMA is also plotted.
Trade Filter:
Bullish: Trade ONLY if price is above 20 EMA.
Bearish: Trade ONLY if price is below 20 EMA.
Entry:
LONG: Enter when price breaks and closes above the H4 pivot AND is above 20 EMA.
SHORT: Enter when price breaks and closes below the L4 pivot AND is below 20 EMA.
Stop Loss:
LONG: Place stoploss at H3 (the next lower Camarilla resistance).
SHORT: Place stoploss at L3 (the next higher Camarilla support).
Target:
Always set a profit target at 2x the distance (risk) between entry and stoploss (strict R:R 2).
For example, if your entry is at H4 and stoploss at H3, your target is entry + 2*(entry - stoploss).
Alerts & Visuals:
The strategy plots entry arrows, stoploss and target lines for immediate visual reference.
Alerts trigger on breakout signals so you never miss a trade.
Why This Works Well for Natural Gas
Adapts to volatility: The pivots change daily, handling wide-ranging and choppy price moves better than fixed breakouts.
Trend filter: EMA prevents counter-trend whipsaws, only trades with market momentum.
Risk control: Every trade must meet strict risk-reward criteria, so losses are contained and winners can outweigh losers.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.