Tradehook — Trading Automation Service
mediumTechnical Indicator

ATTraderAlgo

The ATTrader Algorithm uses ATR-based trend detection and position management to capture extended directional moves. The system adapts to current volatility conditions, using wider stops in volatile markets and tighter stops in calm markets.

TradingView Preview
See this algorithm in action on real charts
ATTraderAlgo TradingView chart
Performance Metrics
Historical backtesting results
51.9%
Win Rate
1.19
Profit Factor
16.7%
Max Drawdown
$134
Avg Trade
Based on 453 trades

About This Algorithm

ATR TREND FOLLOWING SYSTEM

Quick Facts:

  • Category: Trend Following
  • Markets: Trending markets (Futures, Forex)
  • Timeframes: 15min, 1H, 4H, Daily

Overview

The ATTrader Algorithm uses ATR-based trend detection and position management to capture extended directional moves. The system adapts to current volatility conditions, using wider stops in volatile markets and tighter stops in calm markets.

The algorithm identifies trend direction using ATR-based channels and enters on pullbacks within the trend, riding winners while dynamically managing risk based on market volatility.


How It Works

ATR CHANNEL CALCULATION Dynamic trend channels based on volatility:

  • Basis: EMA or SMA of close
    • Upper Channel: Basis + (ATR × channelMultiplier)
    • Lower Channel: Basis - (ATR × channelMultiplier)

TREND DIRECTION Determined by price position relative to channels:

  • Uptrend: Close > Basis AND Close[1] > Basis[1]
    • Downtrend: Close < Basis AND Close[1] < Basis[1]
    • Ranging: Close oscillating around Basis

PULLBACK ENTRIES Wait for retracements within the trend:

  • Bullish Pullback: Price touches lower channel in uptrend
    • Bearish Pullback: Price touches upper channel in downtrend

VOLATILITY-ADAPTIVE STOPS All stops and targets scale with ATR:

  • Stop Loss = Entry ± (ATR × stopMultiplier)
    • Take Profit = Entry ± (ATR × profitMultiplier)
    • Trailing Stop = Highest/Lowest - (ATR × trailMultiplier)

Key Parameters

ATR CHANNEL:

  • atrPeriod (14): ATR calculation period
    • channelMultiplier (2.0): Channel width as ATR multiple
    • basisType ("EMA"): "EMA" or "SMA" for basis line
    • basisPeriod (20): Period for basis calculation

TREND DETECTION:

  • trendConfirmBars (2): Bars required to confirm trend
    • minATR (0.5): Minimum ATR for trade consideration

ENTRIES:

  • entryMode ("Pullback"): "Pullback" or "Breakout"
    • pullbackDepth (0.5): How deep pullback must be (channel ratio)

Best Use Cases

✅ TREND FOLLOWING in trending markets ✅ SWING TRADING with volatility-adjusted risk ✅ POSITION TRADING on higher timeframes ✅ VOLATILITY ADAPTATION across market conditions

Customer Reviews

No reviews yet. Be the first to review this algorithm!
Technical Indicator
Requires Technical Indicator Plan

Subscribe to Technical Indicator or higher to access

Subscription Access

Get access to this indicator/strategy on TradingView through our invite-only system. Your TradingView account will be granted access.

One-Time Purchase

Own the complete Pine Script source code forever. Modify, customize, and use it on your own TradingView account.

$1,500
Subscribe to any tier to unlock one-time purchases

What you get with source code:

  • Complete Pine Script v5 source code
  • Lifetime ownership - no recurring fees
  • Full customization rights
  • Use on your own TradingView account
PlatformTradingView
Subscription AccessTradingView Invite
One-Time PurchaseSource Code
LicensePersonal Use

We Value Your Privacy

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy for more information.