Select Page

Donchian Channels System Strategy for TradingView

APIBridge, TradingView

Donchian Channels was developed by Richard Donchian in 1949.

The high, mid, and low lines have been plotted to show how this system works. The blue line is the high line. The gray line is the mid line. The red line is the low line.

Entry signals are generated when the current close closes above the highest price for a long trade or below the lowest price for a short trade over n periods.

Donchian Channels System Strategy for TradingView

Strategy Logic

Long Entry: When price closes above the high of past n candles, send LE

Long Exit: Either when SL or Target is hit. If SL/TGT is not hit, and when price hits the midline, send LX, else, if the candle closes below low of the past n candles, send LX and SE

Short Entry: When price closes below the low of past n candles, send SE

Short Exit: Either when SL or Target is hit. If SL/TGT is not hit, and when price hits the midline, send SX, else, if the candle closes above high of the past n candles, send SX and LE

Donchian Channels Systems Parameters for TradingView Charts

Period: Period for looking back to n candles  

Quantity: This is used to specify the trade quantity 

Custom Stop Loss in Points: Movement in chart price against the momentum which will trigger exit

Custom Target in Points: Movement in chart price against the momentum which will trigger exit

TradingView Settings

Step 1: Download the PineScript Algo

Step 2: Open desired chart in TradingView with the normal candlestick. Select desired time frame of the chart.

Go to the Pine Editor section, remove the default code, paste the downloaded code, save the file and add it to the chart.

TradingView Settings

Step 3: Once Strategy is applied to the chart, click on settings to optimize parameters for your own trading

optimize parameters for your own trading

Step 4: Setting Up Alert

Before setting up an alert make sure that You have selected the desired script, timeframe, strategy settings, API bridge is configured and running. Click in settings add alert and paste {{strategy.order.comment}} in the message box.

Important: Do not change any settings during live trading.

NOTE: The pine script works both with webhook alerts (TV Pro plan) and normal popup alerts (TV free plan).