PROTECTED SOURCE SCRIPT

BTC High Low Auto Trader Fixed

76
"BTC High Low Auto Trader Fixed", is a swing-based auto-trading system designed to trade Bitcoin (BTC) using price action around recent highs and lows, with risk controls and an optional trend filter. Here's a clear and structured breakdown:

🔍 Strategy Overview
Name: BTC High Low Auto Trader Fixed
Core Idea: Buy near local swing lows and sell near swing highs, optionally filtered by EMA trend direction.

📌 Key Components
1. Swing High/Low Detection (Trade Signals)
A Swing Low is detected when the current bar’s low is the lowest in a lookback window (default: 5 bars before and after).

A Swing High is detected when the current bar’s high is the highest in the same lookback window.

2. Trade Conditions
Long Entry: On a Swing Low.

Short Entry: On a Swing High.

Shorts are filtered if Use EMA Filter is enabled: only allowed when price is below the EMA (i.e., in a downtrend).

3. Risk Management
Stop Loss (%): A fixed % below (long) or above (short) the entry price (default: 1%).

Take Profit (%): A fixed % above (long) or below (short) the entry price (default: 2%).

Trailing Stop (optional): Adjusts the stop loss dynamically as price moves in your favor (default: off).

4. Position Management
Only one trade at a time: the script avoids opening new trades if a position is already open.

Uses a fixed position size (contracts or lots), not percentage of equity.

5. Trend Filter (Optional)
Uses a 200-period EMA to determine trend direction.

When enabled:

Shorts only allowed if price is below the EMA (downtrend).

Longs are always allowed.

📈 Visual Features
Labels mark Buy and Sell points.

Shapes highlight Swing Highs and Lows on the chart.

Dynamic EMA Line changes color based on trend:

Green: Uptrend (price above EMA)

Red: Downtrend (price below EMA)

Optional lines for stop loss and take profit levels.

⚙️ User-Configurable Inputs
Parameter Description Default
Lookback Period Number of bars used to detect swings 5
Stop Loss % % distance from entry for stop loss 1.0%
Take Profit % % distance from entry for take profit 2.0%
Use Trailing Stop Whether to enable dynamic trailing stop false
Trailing Stop % Distance for trailing stop (if enabled) 0.5%
Use EMA Filter Enable trend filter for shorts true
EMA Length EMA period for trend filter 200
Position Size Number of contracts per trade 1.0

🧠 Trading Logic Summary
Buy (Long):

When price forms a swing low.

Execute with SL/TP or trailing stop.

Optional labels/plotting.

Sell (Short):

When price forms a swing high.

Only if price is below the EMA (if trend filter enabled).

Execute with SL/TP or trailing stop.

No pyramiding: One position at a time, avoiding duplicate entries.

📊 Backtesting
Default starting capital: $10,000

Strategy results visible in TradingView’s Strategy Tester:

Net profit/loss

Win rate

Max drawdown

Trade count

Sharpe ratio

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.