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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?