Strategy Setup
How to properly configure a trading strategy with TradeWzrd automation.
Entry + Exit Pairs
Every automated strategy needs two signals:
- Entry signal - Opens the trade
- Exit signal - Closes the trade
Never run entry signals without corresponding exit signals. This leads to accumulating positions with no way to close them.
Method 1: Single Webhook (Recommended)
One webhook handles both entries and exits.
TradingView Setup
Create two alerts on the same webhook:
Alert 1: Entry
- Condition: Your buy condition
- Message:
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Alert 2: Exit
- Condition: Your exit condition
- Message:
CLOSE, {{ticker}}, SIDE=BUY
Both alerts use the same webhook URL.
Pine Script Example
//@version=5
strategy("Complete Strategy", overlay=true)
// Entry conditions
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
// Exit conditions
exitLong = shortCondition // Exit when opposite signal
exitShort = longCondition
// Execute and alert
if (longCondition)
strategy.entry("Long", strategy.long)
alert("BUY, " + syminfo.ticker + ", RISK=2, SL=30, TP=60, TPSLType=PIPS")
if (shortCondition)
strategy.entry("Short", strategy.short)
alert("SELL, " + syminfo.ticker + ", RISK=2, SL=30, TP=60, TPSLType=PIPS")
if (exitLong)
strategy.close("Long")
alert("CLOSE, " + syminfo.ticker + ", SIDE=BUY")
if (exitShort)
strategy.close("Short")
alert("CLOSE, " + syminfo.ticker + ", SIDE=SELL")
Method 2: Exit on Opposite Entry
Exit existing position when opposite entry triggers.
This is common for trend-following strategies:
- Long signal → Close shorts + Open long
- Short signal → Close longs + Open short
Implementation
Long Entry (closes shorts first):
CLOSE, {{ticker}}, SIDE=SELL
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Send as two separate alerts, or combine with line breaks in TradingView message.
Exit Strategies
1. Signal-Based Exit
Exit when indicator gives exit signal.
CLOSE, {{ticker}}, SIDE=BUY
Best for: Mean reversion, RSI strategies
2. SL/TP Exit (Automatic)
Set SL/TP on entry, broker closes automatically.
BUY, {{ticker}}, VOL=0.1, SL=30, TP=60, TPSLType=PIPS
Best for: Set-and-forget, clear targets
3. Time-Based Exit
Close all at end of session.
Create scheduled alert in TradingView:
Best for: Day trading, no overnight holds
4. Partial Take Profit
Close portion at first target, let rest run.
First target (50% close):
CLOSE, {{ticker}}, SIDE=BUY, PERCENT=50
Trail stop on remainder:
MODIFY, {{ticker}}, SIDE=BUY, SL={{low}}, TPSLType=PRICE
Risk Management
Always Use SL/TP
Never trade without stop loss. This is non-negotiable.
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Risk-Based Position Sizing
Use RISK=X instead of VOL=X:
| Risk % | Effect |
|---|
| 1% | Conservative, lower drawdowns |
| 2% | Standard, balanced risk |
| 3%+ | Aggressive, higher drawdowns |
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Risk-Reward Ratio
Calculate TP based on SL:
| SL (pips) | R:R | TP (pips) |
|---|
| 30 | 1:1 | 30 |
| 30 | 1:2 | 60 |
| 30 | 1:3 | 90 |
1:2 minimum recommended for profitability.
Multi-Symbol Strategy
Using Placeholder
Same alert works on any chart:
BUY, {{ticker}}, RISK=2, SL=30, TP=60, TPSLType=PIPS
Create the same alert on multiple charts - each triggers with correct symbol.
Symbol-Specific Adjustments
Override parameters per symbol in code:
slPips = syminfo.ticker == "XAUUSD" ? 100 : 30
tpPips = syminfo.ticker == "XAUUSD" ? 200 : 60
alert("BUY, " + syminfo.ticker + ", RISK=2, SL=" + str.tostring(slPips) + ", TP=" + str.tostring(tpPips) + ", TPSLType=PIPS")
Testing Workflow
Backtest in TradingView
Use Strategy Tester to validate logic
Connect Demo Account
Link demo broker account in TradeWzrd
Test Entry Signal
Trigger entry, verify trade opens
Test Exit Signal
Trigger exit, verify trade closes
Run Paper Trading
Let it run for a few days on demo
Go Live
Switch to live account when confident
Next Steps