boonthegoon

Savage Morning

boonthegoon 已更新   
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.
發布通知:
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)
發布通知:
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.
發布通知:
Key level 4 was miss labeled, just fixed that oversight.
發布通知:
Still need to fix the color issue
發布通知:
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.
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?