boonthegoon

Savage Morning

boonthegoon Zaktualizowano   
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.
Informacje o Wersji:
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)
Informacje o Wersji:
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.
Informacje o Wersji:
Key level 4 was miss labeled, just fixed that oversight.
Informacje o Wersji:
Still need to fix the color issue
Informacje o Wersji:
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.
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?