PROTECTED SOURCE SCRIPT

AutoTrader v3.0[by Irum]

40
1. 스크립트 목적 / 정의
1-1. 한글 설명

이 스크립트의 목적

15분봉 BTC/USDT 같은 레버리지/선물 환경에서,
“EMA 재돌파 + BB 스퀴즈 국면”에서만 진입하고,
상위 추세(레짐 필터) + ATR 기반 리스크/수량 + ATR 트레일링 + 부분청산을 한 번에 관리하는 “올인원 자동 전략”입니다.

핵심 특징:

진입 로직

EMA(기본 9) 를 기준으로

종가가 EMA를 위로 돌파(골든크로스) & BB 폭이 좁을 때 → Long 진입 후보

종가가 EMA를 아래로 돌파(데드크로스) & BB 폭이 좁을 때 → Short 진입 후보

이걸 “Re-break + Squeeze” 구조로 설계해서,
변동성이 줄었다가 방향이 다시 나오려는 시점만 노립니다.

레짐 필터(Regime Filter)

상위 타임프레임(기본 1시간봉 HTF EMA 200)의 기울기와
ATR 빠른 선/느린 선으로

상승 추세 + 변동성 살아있는 구간만 Long 허용

하락 추세 + 변동성 살아있는 구간만 Short 허용

즉, 역추세 매매를 최대한 차단하고, 추세 방향만 따라갑니다.

Pivot 기반 손절 + ATR 리스크 기반 수량(ATR Sizing v2.1)

최근 swing low/high(피벗) 또는 일정 구간 fallback low/high를 기준으로 기술적 손절선을 잡고,

그 손절까지의 거리를 이용해,

“한 번의 손절 시 계좌의 riskPct%만 잃도록” 수량을 자동 계산합니다.

ATR 스파이크(갑작스러운 변동성 폭발) 구간은 진입 자체를 피하려고 합니다.

R-multiple 기반 TP + 부분 청산 + ATR Ladder 트레일링

진입 시점의 위험(R = Entry - SL) 을 기준으로

R 배수 기준 부분청산(예: 1R에서 50% 청산)

R 배수 기준 최종 TP(예: 2R)

포지션이 잘 가면 ATR 기반 트레일링 스탑(ATR Ladder) 을 적용해서,

이익 구간에서 손절선을 점점 끌어올려 BE(본전 이상) → 수익 보호 모드로 전환합니다.

세션 필터 / 뉴욕 뉴스피크 회피용 세션 회피

사용자가 정한 세션 안에서만 매매하거나,

특정 뉴스 타임(예: CPI, FOMC 근처 시간대)을 회피하도록 시간대를 차단할 수 있습니다.

1-2. English Description

Purpose

This strategy is an all-in-one auto-trading system designed mainly for leveraged/futures markets (e.g., BTC/USDT 15m) that:

Enters only on EMA re-break + Bollinger Band squeeze

Uses higher timeframe regime filter for trend direction

Sizes positions with ATR-based risk (v2.1)

Manages exits with R-multiple partial TP + final TP + ATR ladder trailing stop

Key points:

Entry Logic

Uses a fast EMA (default 9).

When price crosses above EMA and BB width is below threshold (squeeze) → Long signal.

When price crosses below EMA and BB width is below threshold → Short signal.

So it focuses on volatility contraction → re-expansion setups.

Regime Filter

Uses HTF EMA (default 200 EMA on 60m) slope + fast vs slow ATR:

Only allow long trades in uptrend + active volatility

Only allow short trades in downtrend + active volatility

This is to avoid counter-trend trading and align with macro trend.

Pivot-based SL + ATR Sizing v2.1

Sets SL using recent pivot highs/lows with a minimum buffer.

Computes risk per unit and chooses quantity so that riskPct % of equity is lost at SL.

Filters out trades during ATR spikes (abnormally large volatility).

R-multiple TP + Partial + ATR Ladder Trailing

Uses the initial risk (R) to:

Take partial profit at partialRR R (e.g., 1R at 50% size).

Set final TP at finalRR R or a fixed % TP.

Uses ATR ladder trailing to progressively tighten stops as price moves in favor.

Session / News Avoidance

Optionally trade only inside a custom session,

Or avoid specific time windows (e.g., high-impact news).

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.