OPEN-SOURCE SCRIPT
Closing Price Donchian Channels

//version=5
indicator("Closing Price Donchian Channels", overlay=true)
// Input parameters
length = input.int(20, "Period", minval=1)
showMid = input.bool(true, "Show Middle Line")
// Calculate upper and lower bands based on closing prices
upper = ta.highest(close, length)
lower = ta.lowest(close, length)
mid = (upper + lower) / 2
// Plot the bands
upperBand = plot(upper, "Upper Band", color=color.rgb(0, 184, 222))
lowerBand = plot(lower, "Lower Band", color=color.rgb(0, 184, 222))
midLine = plot(showMid ? mid : na, "Middle Line", color=color.rgb(209, 212, 220))
// Fill the area between bands
fill(upperBand, lowerBand, color=color.rgb(0, 184, 222, 90), title="Channel Fill")
indicator("Closing Price Donchian Channels", overlay=true)
// Input parameters
length = input.int(20, "Period", minval=1)
showMid = input.bool(true, "Show Middle Line")
// Calculate upper and lower bands based on closing prices
upper = ta.highest(close, length)
lower = ta.lowest(close, length)
mid = (upper + lower) / 2
// Plot the bands
upperBand = plot(upper, "Upper Band", color=color.rgb(0, 184, 222))
lowerBand = plot(lower, "Lower Band", color=color.rgb(0, 184, 222))
midLine = plot(showMid ? mid : na, "Middle Line", color=color.rgb(209, 212, 220))
// Fill the area between bands
fill(upperBand, lowerBand, color=color.rgb(0, 184, 222, 90), title="Channel Fill")
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.