OPEN-SOURCE SCRIPT

Webhook Alert Strategy Template

209
Educational strategy shell that builds webhook-ready alert messages from strategy order fills.

Why this exists
Most traders can write an entry condition. The hard part is packaging a clean, risk-defined exit and a stable alert string that an external webhook receiver can parse. This template is a starting shell for that workflow.

What it does
- Demo entry: MA crossover (EMA/SMA/WMA/RMA selectable). Replace this with your own logic.
- Risk exits: ATR-based stop distance (or fixed pip distance), take-profit from risk:reward.
- Alert messages: attaches comma-separated command strings to strategy entries and exits using alert_message.

Message format examples
BUY,XAUUSD,VOL=0.01,SL=120.5,TP=241,TPSLTYPE=PIPS
SELL,XAUUSD,VOL=0.01,SL=120.5,TP=241,TPSLTYPE=PIPS
CLOSE,XAUUSD

How to use
1. Add the strategy to a standard chart (gold/forex/indices work well).
2. Set VOL, ATR stop, and RR in inputs.
3. Create one alert on this strategy.
4. Choose order fills and alert() function calls.
5. Set the alert message field to exactly: {{strategy.order.alert_message}}
6. Enable webhook URL notifications and paste your own webhook endpoint.

What this is not
This is not a signal service and not financial advice. Default MA entry is only a placeholder so the shell compiles and can be tested. Backtest results with the demo entry are not a performance claim.

Originality
The useful part is the combination of risk-defined strategy exits plus explicit webhook command string generation on fills, so users can learn alert_message plumbing without rebuilding exits from scratch.

Defaults used for this publication
- Symbol: XAUUSD (OANDA)
- Timeframe: 1D
- Initial capital: 10000
- Position size: 2% of equity
- Commission: 0.02%
- Slippage: 2 ticks

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.