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

Script open-source

In pieno spirito TradingView, l'autore di questo script lo ha pubblicato open-source, in modo che i trader possano comprenderlo e verificarlo. Un saluto all'autore! È possibile utilizzarlo gratuitamente, ma il riutilizzo di questo codice in una pubblicazione è regolato dal nostro Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Vuoi usare questo script sui tuoi grafici?

Declinazione di responsabilità