OPEN-SOURCE SCRIPT

ABHITHEMAHI Previous Day High/Low & Round Numbers

//version=5
indicator(title="Previous Day High/Low & Round Numbers", overlay=true)

// Previous Day High and Low
prevHigh = request.security(syminfo.ticker, "D", high[0])
prevLow = request.security(syminfo.ticker, "D", low[0])
prevclose = request.security(syminfo.ticker, "D", close[0])
// Determine if the chart is intraday
isIntraday = ta.change(time("D")) == 0

// Plot Previous Day High and Low
plot(isIntraday ? prevHigh : na, title="Previous Day High", style=plot.style_cross, color=color.red, linewidth=2)
plot(isIntraday ? prevLow : na, title="Previous Day Low", style=plot.style_cross, color=color.green, linewidth=2)
plot(isIntraday ? prevclose : na, title="prevclose", style=plot.style_cross, color=color.green, linewidth=2)

// Round Number Levels
incrementVal = input.float(defval=500, title="Unit Place Rounding Value", tooltip="The Unit Place that a number will be rounded and distance between rounded levels. Example Value setting of 100 and a price of 225.00 would result in a line level value of 200.00; Where a price of 265.00 would result in a line level value of 300 with the same value setting of 100")
lQty = input.int(defval=2, minval=1, maxval=50, title="Line Amount", tooltip="Each Line Amount increase will add a line level above and below baseline level; Baseline = line nearest to price)")
offset = input.int(defval=50, minval=0, maxval=490, step=10, title="Line Price Horizontal Offset", inline="a")
textCol = input.color(defval=color.white, title="Price Label Text Color", tooltip="Use Horizontal Offset to adjust the X position of the price labels. To hide price labels disable Labels on the style tab", inline="a")
belowColor = input.color(defval=color.blue, title="Line Color Below price", inline="b")
aboveColor = input.color(defval=color.orange, title="Line Color Above price", inline="b")
ext = input.string(defval="To Right", options=["To Right", "Both"], title="Extend Line: ")
float iv = incrementVal
lQty := lQty + 1

// Calculate Round Number Levels
RoundValue(value) =>
math.round(value / iv) * iv

baseVal = RoundValue(close)

// Plot Round Number Levels
if isIntraday
for j = 0 to lQty - 1
line.new(bar_index, baseVal + (j * iv), bar_index+1, baseVal + (j * iv), extend=ext == "Both" ? extend.both : extend.right, color=close > baseVal + (j * iv) ? belowColor : aboveColor)

for k = 1 to lQty - 1
line.new(bar_index, baseVal - (k * iv), bar_index+1, baseVal - (k * iv), extend=ext == "Both" ? extend.both : extend.right, color=belowColor)
Candlestick analysisChart patterns

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항