OPEN-SOURCE SCRIPT

Previous Day and Week Levels DDT

//version=5
indicator("Previous Day and Week Levels", overlay=true)

// Get the previous day's high, low, and close
previousDayHigh = request.security(syminfo.tickerid, "D", high[1])
previousDayLow = request.security(syminfo.tickerid, "D", low[1])
previousDayClose = request.security(syminfo.tickerid, "D", close[1])

// Get the previous week's high and low
previousWeekHigh = request.security(syminfo.tickerid, "W", high[1])
previousWeekLow = request.security(syminfo.tickerid, "W", low[1])

// Plotting the previous day's high, low, and close
plot(previousDayHigh, color=color.red, linewidth=2, title="Previous Day High", style=plot.style_line)
plot(previousDayLow, color=color.green, linewidth=2, title="Previous Day Low", style=plot.style_line)
plot(previousDayClose, color=color.blue, linewidth=2, title="Previous Day Close", style=plot.style_line)

// Plotting the previous week's high and low
plot(previousWeekHigh, color=color.purple, linewidth=2, title="Previous Week High", style=plot.style_line)
plot(previousWeekLow, color=color.orange, linewidth=2, title="Previous Week Low", style=plot.style_line)

// Optionally, add labels for visual clarity
label.new(bar_index, previousDayHigh, text="Prev Day High", color=color.red, style=label.style_label_up, yloc=yloc.abovebar)
label.new(bar_index, previousDayLow, text="Prev Day Low", color=color.green, style=label.style_label_down, yloc=yloc.belowbar)
label.new(bar_index, previousDayClose, text="Prev Day Close", color=color.blue, style=label.style_label_left, yloc=yloc.abovebar)
label.new(bar_index, previousWeekHigh, text="Prev Week High", color=color.purple, style=label.style_label_up, yloc=yloc.abovebar)
label.new(bar_index, previousWeekLow, text="Prev Week Low", color=color.orange, style=label.style_label_down, yloc=yloc.belowbar)
educationalFractalPivot points and levels

Skrip open-source

Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menerbitkannya sebagai sumber terbuka, sehingga para trader dapat memahami dan memverifikasinya. Hormat untuk penulisnya! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Inggin menggunakan skrip ini pada chart?

Pernyataan Penyangkalan