This indicator plots a Donchian channel with a long default period of 1440 bars, its midline and a 250-period simple moving average on the price chart.
// Greeffer's Donchian Channel Study
// @version=4
//@Greeffer
// S T U D Y
study(shorttitle="Greeffer's Study", title="Greeffer's Donchian Channel Study", overlay=true)
// S T R A T E G Y
//strategy(
// "Greeffer's Donchian Channel Strategy",
// "Greeffer's Strategy",
// overlay=true,
// pyramiding=10,
// default_qty_type=strategy.percent_of_equity,
// default_qty_value=150,
// initial_capital=5000,
// commission_type=strategy.commission.percent,
// commission_value=0.1,
// margin_long=1./30*50,
// margin_short=1./30*50
// )
// I N P U T S
symbol = "BTCUSDT" //symbol = "ETHUSDT"
sma = input(title="sma", type=input.integer, defval=250)
amount = input(title="amount", type=input.float, defval=0.001, step=0.01)
volumeMA = input(title="volume ma period", type=input.integer, defval=200)
volMultiplyer = input(title="volume multiplyer", type=input.integer, defval=3)
donchianupper = input(title="upper donchian channel period", type=input.integer, defval=1440)
donchianlower = input(title="lower donchian channel period", type=input.integer, defval=1440)
takeprofit = input(title="take profit", type=input.float, defval=1000.00, step=0.01)
stops = input(title="stops", type=input.float, defval=500.00, step=0.01)
// V A R S
short = false
long = false
stopshort = close + stops
stoplong = close - stops
//----------------------?
//symbol = syminfo.ticker
// D O N C H I A N C H A N N E L S
lower = lowest(donchianlower)
upper = highest(donchianupper)
middle= (upper-lower)/2+lower
plot(middle, title='Middle', color=color.green, linewidth=1)
plot(upper, title='Upper', color=color.orange, linewidth=1)
plot(lower, title='Lower', color=color.orange, linewidth=1)
// S M A
plot(sma(close,sma))
// V O L U M E
volMA = sma(volume, 200)
//upperVol = highest(volume, 200)
upperVol = volMA*volMultiplyer
// E N T R Y / E X I T C o n d i t i o n s
// S h o r t
if high>=upper and volume>upperVol
short:=true
else
short:=false
// L o n g :
if low<=lower and volume>upperVol
long:=true
else
long:=false
// O R D E R S :
if short==true
alert(message='{"side":"limitSell","limit":"'+tostring(high)+'","stopPrice":"'+tostring(stopshort)+'","takeProfit":"'+tostring(high-takeprofit)+'","symbol":"'+symbol+'","close":"'+tostring(close)+'","amount":"'+tostring(amount)+'"}', freq=alert.freq_once_per_bar_close)
// must have hedge mode enabled:
//alert(message='{"side":"shortHedge","stopPrice":"'+tostring(stopshort)+'","takeProfit":"'+tostring(high-takeprofit)+'","symbol":"'+symbol+'","close":"'+tostring(close)+'","amount":"'+tostring(amount)+'"}', freq=alert.freq_once_per_bar_close)
if long==true
alert(message='{"side":"limitBuy","limit":"'+tostring(low)+'","stopPrice":"'+tostring(stoplong)+'","takeProfit":"'+tostring(low+takeprofit)+'","symbol":"'+symbol+'","close":"'+tostring(close)+'","amount":"'+tostring(amount)+'"}', freq=alert.freq_once_per_bar_close)
// must have hedge mode enabled:
//alert(message='{"side":"longHedge","stopPrice":"'+tostring(stoplong)+'","takeProfit":"'+tostring(low+takeprofit)+'","symbol":"'+symbol+'","close":"'+tostring(close)+'","amount":"'+tostring(amount)+'"}', freq=alert.freq_once_per_bar_close)
Overview
When a high reaches the upper band, or a low reaches the lower band, on volume above a multiple of its moving average, it sends a JSON alert message with a limit price, stop price, take-profit price and order amount. It is aimed at bot-style alert automation and does not itself place orders.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
sma
int
250
sma
amount
float
0.001
amount
volume ma period
int
200
volumeMA
volume multiplyer
int
3
volMultiplyer
upper donchian channel period
int
1440
donchianupper
lower donchian channel period
int
1440
donchianlower
take profit
float
1000.00
takeprofit
stops
float
500.00
stops
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Point-Clip Unified Indicator plots breakout and directional labels on the price chart. It scores volume spikes against a volume average, range or opening-range breaks, optional VWAP or session-anchored VWAP, fast and slow EMA trend, and a higher-timeframe EMA
This indicator plots several New York opening-range breakout models on the price chart and can also show a combined confidence-scored signal. Enabled models include classic Crabel, a five-minute scalper, a standard fifteen-minute breakout, and a gold variant,
This script identifies and visualizes bullish and bearish order blocks on the price chart. It detects low-volatility consolidation ranges followed by breakout moves accompanied by high trading volume. Users can select between Simple, Relative, or Weighted volu
This indicator identifies and plots price compression zones directly on the price chart using multi-module scoring. It measures ATR compression, ADX chop levels, boundary touches, volume dry-up, and historical pivot levels to identify consolidation areas and s
This indicator plots opening range breakout levels across multiple timeframes, including five, fifteen, thirty, and sixty minutes, directly on the price chart. It also displays the session open and overnight high and low levels. The script calculates an openin
This indicator marks momentum breakouts on the price chart. A signal appears only when the bar makes a new high over the lookback, volume is at least a chosen multiple of the 20-bar average, the percentage change from the prior close meets a minimum, the close