ChrisMoody

CM_Donchian Channels Modified_V2 - Alert Capable

CM_Donchian Channels Modified_V2 With Alert Capability

***This Indicator was created by user Request to Add Alerts Capabilities for Donchian Channels.

New Features:
***Alerts Work - Ability To Create Alerts From Main Indicator.
***Can Also Be Used In Conjunction with Lower Indicator - CM_Donchian Channels Modified_V2_Lower_Alert
***Added Ability To Turn On/Off Highlight Bars.
***Added Ability to Turn On/Off Donch Channel Midline
***Added Ability to Turn On/Off Triangles That Plot At Top and Bottom Of Chart When Breakout Condition is TRUE.

Special Indicator Features:
***Ability To Use Different LookBack Period on Upper and Lower Donch Channel Lines.

How To Create Alerts:
***Create Alert by selecting Indicator - Either the name of the Upper Or Lower Indicator...
***Then select either Alert Breakout Upside or Downside(To The Right Of Indicator Name)
***Select Greater Than
***Select Value
***For Value put .99


Original Post Explaining Indicator is -
***If You Need Help Getting Custom Indicators to Trigger Alerts then View This Post.

Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?
//Modified Donchonian Channel with separate adjustments for upper and lower levels
//Purpose is if you expect big move up, Use lower input example 3 or 4, and longer lower input, 40 - 100 and use lower input line as a stop out
//Opposite if you expect big move down
//Mid Line Rule in Long Example.  If lower line is below entry take partial profits at Mid Line and move stop to Break even.
//If Lower line moves above entry price before price retraces to midline use Lower line as Stop...Opposite if Shorting
//Created by user ChrisMoody 1-30-2014

//Updated 12-14-2014 by ChrisMoody, Added Alert Capability, Bars Change Colors Based on Breakouts.Arrows At Bottom Showing Entry
//Create Alert by selecting Indicator, then either Alert Breakout Upside or Downside, Select Greater Than, Select Value, for Value put .99

study(title="CM_Donchian Channels Modified_V2", shorttitle="CM_DC Modified_V2", overlay=true)
length1 = input(20, minval=1, title="Upper Channel")
length2 = input(20, minval=1, title="Lower Channel")
sml = input(true, title="Show Mid-Line?")
shb = input(true, title="Show Highlight Bars When Breaking out?")
sa = input(true, title="Show Arrows on Top And Bottom of Screen When Breaking Out?")

upper = highest(length1)
lower = lowest(length2)
basis = avg(upper, lower)

break_Above = close > upper[1] ? 1 : 0
break_Below = close < lower[1] ? 1 : 0

break_AboveHB() => shb and close > upper[1] ? 1 : 0
break_BelowHB() => shb and close < lower[1] ? 1 : 0

plot(break_Above, title="Alert Breakout Upside", style=circles, linewidth=1, color=white)
plot(break_Below, title="Alert Breakout Downside", style=circles, linewidth=1, color=white)

barcolor(break_AboveHB() ?  fuchsia : na)
barcolor(break_BelowHB() ?  fuchsia : na)

plotshape(sa and break_Above ? break_Above : na, title="Arrows Showing Break Above", style=shape.triangleup, location=location.bottom, color=lime)
plotshape(sa and break_Below ? break_Below : na, title="Arrows Showing Break Above", style=shape.triangledown, location=location.top, color=red)

u = plot(upper, title="Upper DC Band", style=line, linewidth=4, color=lime)
l = plot(lower, title="Lower DC Band", style=line, linewidth=4, color=red)
plot(sml and basis ? basis : na, title="Mid-Line", color=yellow, style=line, linewidth=1)

fill(u, l, color=white, transp=75, title="Fill")