9Week_Candle
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © yasujiy
//@version=5
indicator(title = 'nPeriod_Candle', overlay=false)
Length = input.int(9, minval = 2, title = "Length")
Len = Length - 1
donchianLow(Len) => ta.lowest(Len)
donchianHigh(Len) => ta.highest(Len)
m_close = close
m_open = open[Len]
m_high = donchianHigh(Len) 
m_low = donchianLow(Len) 
plotcandle(m_open, m_high, m_low, m_close, title='', color=m_open < m_close ? color.white : color.blue, wickcolor=color.black)
