Stochastic cross in extremes
Stochastic cross in extremes is an alert that checks every 1 hour, can fire every time its condition is met, waits 3 bars between alerts and shows whe
core language
alert "Stochastic cross in extremes"check: every 1hrepeat: every timecooldown: 3 barsshow_on_chart: truek_line = stoch().kd_line = stoch().dwhen crosses_above(k_line, d_line) and k_line < 20:notify "Stochastic bullish cross at {k_line:0} on {market.symbol}"when crosses_below(k_line, d_line) and k_line > 80:notify "Stochastic bearish cross at {k_line:0} on {market.symbol}"Stochastic cross in extremes is an alert that checks every 1 hour, can fire every time its condition is met, waits 3 bars between alerts and shows where it fires on the chart.
It calculates k_line as the k of the stochastic and d_line as the d of the stochastic.
When k_line crosses above d_line and k_line is below 20, it sends the notification "Stochastic bullish cross at {k_line:0} on {market.symbol}".
When k_line crosses below d_line and k_line is above 80, it sends the notification "Stochastic bearish cross at {k_line:0} on {market.symbol}".