How to automate Wunder Keltner bot on WunderTrading
Go to the Signal Bot tab and press Create Bot.
Fill in all fields in General section and choose TradingView Strategy as a Bot start condition.
Decide whether you want to insert Max Capital limit and press Create Bot. You will see the following window with Webhook URL and placeholders:
Leave the window opened and go to the TradingView's Supercharts. Click Indicators and select your strategy.
Once the strategy is applied to the chart, choose a Trading pair and the Timeframe.
Adjust your strategy Inputs and Properties, then press Ok.
Open Alert and select your strategy in the Condition field.
Open the Message tab, enter an Alert name, then copy the TradingView Strategy JSON from the Signal Bot window and paste it into the TradingView alert Message field.
Go to the Notifications tab and insert Webhook URL from the Signal bot - https://wtalerts.com/bot/trading_view_strategy . Click Create to finish the process.
Your bot is now fully connected to TradingView and ready to execute trades automatically based on your strategy signals. Whenever the strategy triggers an alert, TradingView will send the webhook with the configured placeholders, allowing the bot to receive accurate, real-time order data.Before running the bot in live conditions, we strongly recommend testing the setup on a demo account or with minimal capital to ensure everything works as expected. Double-check your strategy settings, alert configuration, and placeholder values to avoid execution errors.
Once verified, your automated workflow will run continuously, requiring no manual intervention.
You can always check and research your signals in the TV Logs and the Signal Bot logs:
1. Strategy Overview
The Wunder Keltner Bot is a trend‑following strategy based on Keltner Channels combined with Directional Movement (DI) and an optional ADX strength filter. It enters long when price breaks above the upper Keltner band with +DI above -DI, and short when price breaks below the lower band with -DI above +DI. You can choose between three stop‑loss/take‑profit calculation methods: Keltner, FIX (percentage), or ATR. Additional features include trailing stop, move to breakeven, and full WunderTrading JSON alert integration for automated execution.
The strategy is designed for futures/spot and includes a built‑in position sizing model based on a fixed capital and risk per trade.
2. Quick Start
Add the script to your TradingView chart.
Set the backtest period (optional) to limit the date range.
Configure Core Settings – choose trade direction (Long, Short, Both, None).
Adjust Risk & Money Management – define your capital and risk per trade.
Select your SL/TP type (Keltner, FIX, or ATR) and enable/disable TP/SL.
Fine‑tune Keltner and DI parameters for your asset/timeframe.
Enable optional features (ADX filter, trailing stop, breakeven) as needed.
Set WunderTrading comments if you plan to use automated alerts.
Run a backtest and optimize parameters.
3. Input Parameters Reference
All inputs are grouped logically in the script’s settings panel. Below is a detailed description of each input, its type, limits, default value, and any conditions that activate/deactivate it.
3.1 Backtest Date Range
Input | Type | Limits | Default | Description |
Start |
| true/false | false | Enable start date restriction. |
Start Period |
| any valid timestamp |
| The beginning of the backtest period. |
finish |
| true/false | false | Enable end date restriction. |
End Period |
| any valid timestamp |
| The end of the backtest period. |
Note: Both toggles must be enabled to activate the date filter.
3.2 Core Settings
Input | Type | Options | Default | Description |
Trade direction |
| LONG, SHORT, BOTH, NONE | BOTH | Restricts the direction in which the strategy can open trades. |
3.3 Risk and Money Management
Input | Type | Limits | Default | Description |
Capital $ |
| min=1, max=1,000,000 | 1000 | The amount of capital used for position sizing. |
Volume in contract |
| true/false | true | When enabled, position size is displayed in contracts; when disabled, in quote currency. This affects the Strategy Tester and the webhook signal. |
Risk Per Trade % (only visible when the inline toggle is enabled) |
| min=0.01, step=0.1 | 5.0 | The percentage of capital risked per trade when a stop loss is used. |
3.4 SL/TP Settings
Input | Type | Options / Limits | Default | Description / Activation Condition |
SL/TP TYPE |
| Keltner, FIX, ATR | Keltner | Selects the method for calculating stop‑loss and take‑profit. |
Use TP |
| true/false | true | Enable take‑profit. |
Use SL |
| true/false | true | Enable stop‑loss. |
Take Profit (%) |
| min=0.1 | 3.5 | Used when SL/TP TYPE = FIX and either RR is disabled or SL is disabled. (Active only when those conditions are met.) |
Stop Loss (%) |
| min=0.1, max=100 | 3.5 | Used when SL/TP TYPE = FIX and SL is enabled. (Active only when |
3.5 ATR SL/TP
Visible only when Use TP or Use SL is enabled.
Input | Type | Limits | Default | Description |
ATR length |
| min=1 | 14 | Lookback period for the Average True Range. |
SL multiplier |
| min=0, step=0.01 | 0.9 | Multiplier applied to ATR for stop‑loss distance. |
3.6 Risk / Reward
Visible only when both TP and SL are enabled.
Input | Type | Limits / Options | Default | Description / Activation Condition |
condition RR |
| true/false | true | Master switch for using Risk/Reward ratio. When disabled, TP is set via fixed percentage or ATR. |
simple fraction / Decimal |
| Simple fr, Decimal | Simple fr | Choose RR representation. |
Risk (simple fraction) |
| min=1, max=100 | 4 | Numerator of the RR fraction. (Active only when |
Reward (simple fraction) |
| min=1, max=100 | 5 | Denominator of the RR fraction. (Active only when |
decimal RR |
| min=0.01, max=99.99 | 0.50 | Decimal RR value (e.g., 0.5 means risk:reward = 1:2). (Active only when |
Note: RR is calculated as Risk / Reward (e.g., 4/5 = 0.8 means for every 1 unit risk, reward is 1/0.8 = 1.25).*
3.7 Trailing Stop
Input | Type | Limits | Default | Description |
Use TS |
| true/false | false | Enable trailing stop. |
Trailing Stop Activation (%) |
| min=0.01, step=0.1 | 0.4 | Price movement (in percent from entry) that triggers the trailing stop. |
Trailing Stop Execution (%) |
| min=0.01, step=0.1 | 0.6 | The distance (in percent) behind the highest price (long) or lowest price (short) where the stop is placed after activation. |
3.8 Move Stop Loss to Breakeven
Input | Type | Limits | Default | Description |
Use MSL |
| true/false | false | Enable move to breakeven. |
MSL activation (%) |
| min=0.01, step=0.1 | 0.5 | Price movement (in percent from entry) that triggers moving the stop‑loss to breakeven. |
3.9 Keltner Long
Parameters for the long‑side Keltner Channel.
Input | Type | Limits | Default | Description |
SMA length 1 |
| min=1 | 15 | First SMA period for the channel midline. |
SMA length 2 |
| min=1 | 30 | SMA period for the average true range of the bars (high-low). |
Multiplier |
| step=0.1 | 3.0 | Multiplier applied to the range SMA to set band width. |
3.10 Keltner Short
Parameters for the short‑side Keltner Channel.
Input | Type | Limits | Default | Description |
SMA length 1 |
| min=1 | 20 | First SMA period for the channel midline. |
SMA length 2 |
| min=1 | 110 | SMA period for the average true range of the bars. |
Multiplier |
| step=0.1 | 2.9 | Multiplier applied to the range SMA. |
3.11 DI Long & Short
These inputs control the Directional Movement indicators used as filters.
DI LONG
Input | Type | Limits | Default | Description |
DI Length |
| min=1 | 14 | Period for the Directional Movement calculation. |
key level for ADX |
| min=1 | 30 | Threshold for +DI; long entry requires +DI > this value. |
DI SHORT
Input | Type | Limits | Default | Description |
DI Length |
| min=1 | 14 | Period for the Directional Movement calculation. |
key level for ADX |
| min=1 | 25 | Threshold for -DI; short entry requires -DI > this value. |
3.12 ADX Strength Filter
Input | Type | Limits | Default | Description / Activation |
Use ADX strength filter |
| true/false | false | Master switch. When enabled, entries require ADX >= minimum and ADX rising. |
ADX min (Long) |
| min=1 | 15 | Minimum ADX value for long entries. (Active only when ADX filter is on.) |
ADX min (Short) |
| min=1 | 15 | Minimum ADX value for short entries. (Active only when ADX filter is on.) |
ADX rising bars |
| min=1 | 3 | Number of consecutive bars ADX must be rising to confirm trend strength. |
3.13 WunderTrading Comments
These strings are inserted into the alert messages for WunderTrading bot recognition. They should match the comments configured in your WunderTrading bot.
Input | Type | Default | Description |
Enter Long Comment |
| 'Add me' | Comment from your WunderTrading Signal bot for the long entry signals. |
Exit Long Comment |
| 'Add me' | Comment from your WunderTrading Signal bot for the for long exit signals. |
Enter Short Comment |
| 'Add me' | Comment from your WunderTrading Signal bot for the for short entry signals. |
Exit Short Comment |
| 'Add me' | Comment from your WunderTrading Signal bot for the for short exit signals. |
Exit All Comment |
| 'Add me' | (Not currently used in this version, but reserved for future.) |
5. Best Practices
5.1 Capital & Risk Management
Start small – Use a capital amount that reflects your real trading size. The
Capital $input is used for position sizing based on risk.Risk per trade – A common conservative value is 1‑2% of capital. The default 5% is aggressive; adjust based on your risk tolerance and strategy win rate.
Volume in contract – Keep this enabled (
true) for realistic backtest results (position sized in contracts). Disable only if you need dollar‑based signals for WunderTrading (the webhook will then send quote currency volume).
5.2 Parameter Selection
Keltner settings – The two SMA lengths control the channel’s responsiveness. Shorter lengths react faster but may produce more false signals. Test different combinations.
SL/TP TYPE –
Keltner uses the opposite band as stop‑loss. This is a dynamic, volatility‑adjusted stop. Works well in trending markets.
FIX uses fixed percentages – simpler but may not adapt to changing volatility.
ATR uses a multiple of ATR – also volatility‑adjusted.
Choose based on your asset’s behaviour.
Risk/Reward – If you enable RR, the take‑profit is automatically derived from the stop‑loss distance. This ensures a consistent risk‑reward ratio. Only use RR when both TP and SL are enabled.
5.3 ADX Filter
The ADX filter helps avoid choppy markets. If you enable it, start with
ADX minaround 20‑25 andADX rising bars= 2‑3. Adjust to balance trade frequency and quality.
5.4 Trailing Stop & Breakeven
These features can lock in profits but may also reduce overall profitability if set too tight. Backtest with different activation levels.
Use them as complements to your main SL/TP, not as replacements.
5.5 Backtesting
Use a realistic date range – Include both trending and sideways periods to evaluate robustness.
Optimize cautiously – Avoid over‑optimizing on a small sample. Test parameters across multiple markets/timeframes.
Check for look‑ahead bias – The script only uses past data; all conditions are evaluated on the current bar close. However, note that entries use
openandcloseof the same bar, which is a form of intra‑bar assumption. In real trading, you would enter at the next bar’s open. The script usesclosefor entry price, which may create a slight mismatch. Consider this when interpreting backtest results.
5.6 Commission & Slippage
The strategy sets a default commission of 0.075% (adjustable in the strategy settings). Ensure this reflects your broker’s fees.
Slippage is not modelled; consider adding a small buffer in your expectations.
6. Important Notes & Limitations
Pyramiding is set to 0 – only one position can be open at a time.
Margin settings are 0 – the strategy does not use leverage; position size is based on cash.
The script uses
strategy.cashfor default quantity type; position size is calculated fromcapitaland risk.The strategy uses two separate Keltner channels for long and short – they can have independent parameters. This allows optimisation for different market directions.
The visual plots (Keltner, ADX, DI) can be hidden via the Indicator Visibility toggles to reduce chart clutter.
The Wunder Keltner Bot is a trend‑following strategy that combines Keltner Channels with DI and optional ADX filters. Its flexibility allows you to choose between three stop‑loss methods and add trailing/breakeven features. While the strategy has been designed with robustness in mind, past performance in backtests does not guarantee future results. Market conditions change, and any trading strategy involves risk of loss. Before committing real capital, it is strongly recommended to test the strategy extensively in a demo environment using live market data. This will help you understand its behaviour, optimise parameters for your chosen asset and timeframe, and gain confidence in its signals. Start small, monitor closely, and adjust as needed. Remember that no strategy is foolproof – always practice proper risk management.












