OPEN-SOURCE SCRIPT

Savage Morning

Atualizado
Made for those Savage morning where you need to plot your values quicker.
The following section defines several input variables with default values that can be configured by the user:

resistance, weak_resistance, support, weak_support, gap_price, gap_price2, last_close, key_price, key_price1, key_price2, key_price3: These variables represent various price levels such as resistance, support, gap prices, and key levels. Users can input their own values for these levels when adding the indicator to their chart.
Next, there are boolean input variables that control the visibility of each line:

show_res, show_weak_res, show_sup, show_weak_sup, show_gap, show_gap2, show_last_close, show_key, show_key1, show_key2, show_key3: These variables allow users to choose which lines should be displayed on the chart by toggling them on or off.
Following that, there are multiple plot statements. These statements create plot series for each line that may be displayed on the chart. The plot function determines the value to be plotted based on the user's input and the visibility settings:

plot_res, plot_weak_res, plot_sup, plot_weak_sup, plot_gap, plot_gap2, plot_last_close, plot_key, plot_key1, plot_key2, plot_key3: These variables store the values to be plotted for the respective lines based on the user's input and visibility settings.
After defining the plot series, there are multiple plot statements that actually plot the lines on the chart. Each line has its own color and title specified.

Finally, labels are added on the right side of the lines to provide additional information. The label.new function is used to create labels for each line, displaying their names ("Res," "Weak Res," "Sup," etc.) at the corresponding price levels on the chart.

In summary, this Pine Script code creates a custom indicator named "Savage Morning" that allows users to input various price levels and choose which of these levels should be displayed on their chart. It plots these levels as lines with different colors and labels them for easy identification on the chart. The indicator is designed to help traders visualize important price levels and gaps that they have determined for themselves and make it easier for them to plot or change their own levels.
Notas de Lançamento
Updated V2
- I didn't like how it labeled the the graph, made the chart very messy.
- Added function to be able to adjust the X and Y position of the label to your liking.

// Function to create labels with preferred style, including X offset adjustment
createLabel(price, labelText, txtColor) =>
var label lbl = na // Persistent variable to hold the label reference
if (barstate.islast) // Check if the script is processing the last bar
lbl := label.new(x=bar_index + math.round(label_offset_x), y=price + label_offset, text=labelText, color=color.new(color.black, 100), size=lab_size, textcolor=txtColor, style=label.style_label_center, xloc=xloc.bar_index)
Notas de Lançamento
Fixed the issue where it keeps repeating that label on the chat. Just wanted to get this fix out. The next issue is when the color is changed the label doesn't change with the line. Going to work on it this week.
Notas de Lançamento
Key level 4 was miss labeled, just fixed that oversight.
Notas de Lançamento
Still need to fix the color issue
Notas de Lançamento
I'm still having difficulty making the colors match when they are changed. Savage has been adding more key levels in the morning, so I expanded it so you guys can mark them too. Since I'm having difficulty with the label colors matching when changed, I'm just setting the preset colors to match savage.
Support and Resistance

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal