Advanced Profit Strategy with User-Configurable Alerts
This script provides a trading strategy based on the crossover and crossunder of the closing price with its 10-period simple moving average. It’s designed to be versatile across different timeframes and trading pairs.
Features:
Buy/Sell Indications: The script visually plots “BUY” and “SELL” labels on the chart when the respective conditions are met.
User-Configurable Alerts: Users can opt to enable or disable alerts. When enabled, the script will trigger an alert on Buy or Sell signals, allowing users to be notified in real-time. Each alert is specific to the chart’s trading pair and timeframe, allowing for precise monitoring across multiple setups.
Versatility: Suitable for various assets and timeframes, allowing traders to utilize it in diverse market conditions.
Usage:
Add the script to your chart.
Adjust the “Enable Alerts?” input to your preference.
If alerts are enabled, ensure you set up your preferred alert delivery method (e.g., email, SMS) through the TradingView platform.
Note:
Always ensure to backtest any strategy before applying it to your trades. Past performance is not indicative of future results.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AlexanderJGill
//@version=5
indicator("10% Profit Strategy with Alerts", overlay=true)
// Entry Conditions
longCondition = ta.crossover(close, ta.sma(close, 10))
shortCondition = ta.crossunder(close, ta.sma(close, 10))
// User input for alerts
useAlerts = input.bool(true, "Enable Alerts?")
// Plotting
plotshape(series=longCondition, title="Long Entry", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Short Entry", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// Alerts
if (useAlerts and longCondition)
alert("Buy Signal", alert.freq_once_per_bar_close)
if (useAlerts and shortCondition)
alert("Sell Signal", alert.freq_once_per_bar_close)