var inside_bar = array.new_int(0) var inside_bar_high = array.new_float(0) var inside_bar_low = array.new_float(0) var motherCandleIndex = 0 var motherCandleHigh = 0.0 var motherCandleLow = 0.0 var motherCandleRange = 0.0 var target1Buy = 0.0 var target2Buy = 0.0 var target1Sell = 0.0 var target2Sell = 0.0
var motherCandleH = line.new(na, na, na, na, extend=extend.right, color=color.green) var motherCandleL = line.new(na, na, na, na, extend=extend.right, color=color.red) var motherCandleHLabel = label.new(na, na, style=label.style_label_left, textcolor=color.green, color=color.new(color.green, 80)) var motherCandleLLabel = label.new(na, na, style=label.style_label_left, textcolor=color.red, color=color.new(color.red, 80))
var longT1 = line.new(na, na, na, na, extend=extend.right) var longT2 = line.new(na, na, na, na, extend=extend.right) var shortT1 = line.new(na, na, na, na, extend=extend.right) var shortT2 = line.new(na, na, na, na, extend=extend.right)
var longT1Label = label.new(na, na, textcolor=color.blue, style=label.style_label_left, color=color.new(color.blue, 80)) var longT2Label = label.new(na, na, textcolor=color.blue, style=label.style_label_left, color=color.new(color.blue, 80)) var shortT1Label = label.new(na, na, textcolor=color.blue, style=label.style_label_left, color=color.new(color.blue, 80)) var shortT2Label = label.new(na, na, textcolor=color.blue, style=label.style_label_left, color=color.new(color.blue, 80))
var longT1Line = input.bool(title='Show Long T1', defval=true, group='Long') var longT2Line = input.bool(title='Show Long T2', defval=true, group='Long')
var shortT1Line = input.bool(title='Show Short T1', defval=true, group='Short') var shortT2Line = input.bool(title='Show Short T2', defval=true, group='Short')
var longT1Range = input.float(title='Long T1', defval=1, group='Long (x times above range of mother candle)', tooltip='Line will be plotted above high of mother candle. If value entered is 1, then T1 = range of mother candle x 1') var longT2Range = input.float(title='Long T2', defval=1.5, group='Long (x times above range of mother candle)', tooltip='Line will be plotted above high of mother candle. If value entered is 2, then T2 = range of mother candle x 2')
var shortT1Range = input.float(title='Short T1', defval=1, group='Short (x times below range of mother candle)', tooltip='Line will be plotted below low of mother candle. If value entered is 1, then T1 = range of mother candle x 1') var shortT2Range = input.float(title='Short T2', defval=1.5, group='Short (x times below range of mother candle)', tooltip='Line will be plotted below low of mother candle. If value entered is 2, then T2 = range of mother candle x 1')
hi = high lo = low op = open cl = close
isInside() => previousBar = 1 bodyStatus = cl >= op ? 1 : -1 isInsidePattern = hi < hi[previousBar] and lo > lo[previousBar] isInsidePattern ? bodyStatus : 0
newDay = ta.change(time('D'))
if newDay array.clear(inside_bar) array.clear(inside_bar_high) array.clear(inside_bar_low)
if isInside() and array.size(inside_bar) <= 0 array.push(inside_bar, bar_index) array.push(inside_bar_high, hi[1]) array.push(inside_bar_low, lo[1])
진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.