boonthegoon

Savage Morning

boonthegoon Cập nhật   
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.
Phát hành các Ghi chú:
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)
Phát hành các Ghi chú:
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.
Phát hành các Ghi chú:
Key level 4 was miss labeled, just fixed that oversight.
Phát hành các Ghi chú:
Still need to fix the color issue
Phát hành các Ghi chú:
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.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?