К сожалению, этот скрипт был написан не очень дружелюбно для настройки оповещений. К счастью, исходный код доступен.
Я немного отредактировал код (он имеет ту же функциональность), чтобы он отображал некоторые фигуры вместе с текстом, и вы можете настроить свои оповещения на основе этих фигур.
![enter image description here](https://i.stack.imgur.com/TWT7f.png)
Везде, где исходный индикатор имеет "S" или "B", мой индикатор имеет треугольники "Строгая продажа" или "Строгая покупка". Итак, функциональность одинакова. Конечно, когда вы добавите мой индикатор, у него не будет тех "S" или "B". Над графиком включены оба индикатора.
Теперь вы можете просто сделать «Добавить оповещения» и выбрать новый индикатор (Stoch HL).
![enter image description here](https://i.stack.imgur.com/GmIgI.png)
Затем выберите «Фигуры» и посмотрите на выпадающее меню и выберите фигуру, на которой вы хотите настроить оповещение.
![enter image description here](https://i.stack.imgur.com/UEmZd.png)
Создайте новый индикатор и скопируйте и вставьте код ниже. Сохраните его, а затем добавьте в свой график.
//@version=3
study("Stoch HL", overlay=true)
//Created by ChrisMoody on October 23, 2014 by user request - belgusinc
//Changes Barcolor when Stochastic is Overbought Oversold.
//Necessary for Highlight Bars
//Only Necessary if you want you want Stochastic Croses
len = input(14, minval=1, title="Length for Stochastic")
smoothK = input(3, minval=1, title="SmoothK for Stochastic")
smoothD = input(3, minval=1, title="SmoothD for Stochastic")
upLine = input(80, minval=50, maxval=90, title="Upper Line Value?")
lowLine = input(20, minval=10, maxval=50, title="Lower Line Value?")
//Not Necessary, In Inputs Tab, capability to turn On/Off Highlight Bars, and Both Crosses
//These are all checkboxes in inputs tab....Show Barcolor Highlights, Show Background Hghlight, Plot B and S for Buy Sell
sbc = input(true, title="Show Price Bar highlight When Stoch is Above/Below High/Low Lines?")
sbh = input(false, title="Show Background highlight When Stoch is Above/Below High/Low Lines?")
sch = input(false, title="Show Back Ground Highlights When Stoch Cross - Strict Criteria - K Greater/LesThan High/Low Line - Crosses D ?")
sl = input(true, title="Show 'B' and 'S' Letters When Stoch Crosses High/Low Line & D?")
sac = input(false, title="Show Back Ground Highlights When Stoch Cross - Any Cross?")
sacl = input(false, title="Show 'B' and 'S' Letters When Stoch Crosses - Any Cross?")
//Necessary for Highlight Bars
//Stoch formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)
//Necessary for Highlight Bars
//aboveline = OverBought, belowline = Oversold Definitions
aboveLine = k > upLine ? 1 : 0
belowLine = k < lowLine ? 1 : 0
//Only Necessary if you want you want Stochastic Croses
//Definition for Cross when Above High-Low lines
crossUp = (k[1] < d[1] and k[1] < lowLine[1]) and (k > d) ? 1 : 0
crossDn = (k[1] > d[1] and k[1] > upLine[1]) and (k < d) ? 1 : 0
//Only Necessary if you want you want Stochastic Croses
//Definition for Cross that doesn't have to be above or below High and Low line.
crossUpAll = (k[1] < d[1] and k > d) ? 1 : 0
crossDownAll = (k[1] > d[1] and k < d) ? 1 : 0
//Only Necessary if you want background Highlighting also - Take out the sbh/sbc and part
//BackGround Highlights based on Above/Below Lines, Strict Cross Up/Down
//BackGroound Color Plots
bgcolor(sbh and aboveLine ? red : na, transp=70)
bgcolor(sbh and belowLine ? lime : na, transp=70)
bgcolor(sch and crossUp ? lime : na, transp=40)
bgcolor(sch and crossDn ? red : na, transp=40)
//Only Necessary if you want background Highlighting also
//plots bgcolor Cross with no filter
bgcolor(sac and crossUpAll ? lime : na, transp=40)
bgcolor(sac and crossDownAll ? red : na, transp=40)
//Necessary for Highlight Bars
//Highlight Bar Definitions
overBought() => sbc and aboveLine
overSold() => sbc and belowLine
//Necessary for Highlight Bars
//Highlight Bar Plot Statement based on Above Definitions
barcolor(overBought() ? orange : overSold() ? fuchsia : na)
// Buy and Sell Conditions
bssc = sl and crossUp ? crossUp : na
sssc = sl and crossDn ? crossDn : na
bscu = sacl and crossUpAll ? crossUpAll : na
sscd = sacl and crossDownAll ? crossDownAll : na
//Not Necessary if you just want Highlight Bars - Extra Feature
//These are just the Letters B and Sell Based on Crosses
alertcondition(condition=bssc, title="Strict Buy", message="Buy Signal Strict Criteria.")
alertcondition(condition=sssc, title="Strict Sell", message="Sell Signal Strict Criteria.")
alertcondition(condition=bscu, title="Buy Cross Up", message="Buy Signal Any Cross Up.")
alertcondition(condition=sscd, title="Sell Cross Down", message="Sell Signal Any Cross Down.")
plotshape(bssc, style=shape.triangleup, color=lime, transp=40, text="Strict Buy", editable=false, location=location.belowbar, size=size.small)
plotshape(sssc, style=shape.triangledown, color=red, transp=40, text="Strict Sell", editable=false, location=location.abovebar, size=size.small)
plotshape(bscu, style=shape.triangleup, color=lime, transp=40, text="Buy Cross Up", editable=false, location=location.belowbar, size=size.small)
plotshape(sscd, style=shape.triangledown, color=red, transp=40, text="Sell Cross Down", editable=false, location=location.abovebar, size=size.small)