Bot Configuration

Learn how to configure and optimize your Trading Bot's settings for better performance.

Accessing Bot Settings

  1. Navigate to Trading Bots in the sidebar
  2. Find your bot in the list
  3. Click the Settings icon or bot card
  4. Select the Configuration tab

Configuration Categories

Basic Settings

Bot Name

A descriptive name helps identify your bot:

Format: [SYMBOL] [STRATEGY] [TIMEFRAME] [MODE]
Example: BTC RSI 4H Paper

Tips:

  • Include the trading pair
  • Mention the strategy type
  • Note if paper or live
  • Keep it under 30 characters

Status Control

Toggle your bot's operational status:

StatusDescriptionUse Case
ActiveRunning normallyNormal operation
PausedTemporarily stoppedMaintenance, market uncertainty
StoppedFully disabledLong-term shutdown

Note: Pausing a bot does NOT close open positions. Close positions manually before stopping if needed.

Market Configuration

Trading Symbol

Change the trading pair:

  1. Click the symbol dropdown
  2. Search or browse available pairs
  3. Select new pair
  4. Save changes

Considerations:

  • Strategy may perform differently on new pair
  • Check liquidity of new pair
  • Review position sizing for new pair's price

Timeframe

Adjust the chart timeframe:

ChangeImpact
Higher TFFewer signals, larger moves
Lower TFMore signals, smaller moves

Matching spin interval:

  • Lower timeframe = needs faster spin
  • Check your tier supports required spin speed

Position Sizing

Sizing Mode

Percentage Mode:

Position = Balance × Percentage
Example: $10,000 × 50% = $5,000 per trade

Fixed Mode:

Position = Fixed Amount
Example: Always $1,000 per trade

Amount Configuration

SettingDescriptionRecommendation
10-25%ConservativeBeginners, volatile markets
25-50%ModerateStandard trading
50-75%AggressiveHigh confidence setups
75-100%MaximumSingle-position strategies

Note: Never risk more than you can afford to lose.

Leverage Settings (Futures)

Leverage Level

Configure position leverage:

Effective Position = Balance × Size % × Leverage
Example: $10,000 × 50% × 5x = $25,000 position

Risk Calculation

Leverage2% Move Against5% Move Against
1x2% loss5% loss
3x6% loss15% loss
5x10% loss25% loss
10x20% loss50% loss
20x40% loss100% loss

Note: Higher leverage dramatically increases liquidation risk.

Risk Management

Stop Loss Configuration

Percentage Stop Loss:

Stop Price = Entry × (1 - Stop %)
Example: $50,000 × (1 - 2%) = $49,000

Fixed Price Stop:

  • Set specific price level
  • Useful for technical levels (support/resistance)

ATR-Based Stop:

Stop Price = Entry - (ATR × Multiplier)
Example: $50,000 - ($500 × 2) = $49,000

Recommendations:

Market TypeStop Loss Range
Major pairs (BTC, ETH)1-3%
Altcoins3-5%
High volatility5-10%

Take Profit Configuration

Percentage Take Profit:

TP Price = Entry × (1 + TP %)
Example: $50,000 × (1 + 4%) = $52,000

Risk:Reward Ratios:

R:RStop LossTake ProfitWin Rate Needed
1:12%2%Above 50%
1:22%4%Above 33%
1:32%6%Above 25%

Trailing Take Profit:

  • Follows price as it moves in your favor
  • Locks in profits while allowing for larger moves
  • Configure trail distance percentage

Close on Candle Close

Automatically close all trades at the end of the candle they were entered on. This is useful for intrabar strategies that only want to hold positions within a single candle period.

How It Works

When enabled, every entry trade is tagged with a target close time equal to the end of the current candle (based on the bot's timeframe). The order monitor checks every ~10 seconds and closes the trade when the candle boundary is reached.

Example (4H timeframe):
- Trade opened at 14:30 → scheduled to close at 16:00 (end of 4H candle)
- Trade opened at 15:55 → scheduled to close at 16:00 (same candle)

Settings

SettingDescriptionDefault
Close on Candle CloseEnable/disable the featureOff
Close Offset (seconds)Exit this many seconds before the candle closes0
Minimum Trade Age (minutes)Trade must be open for at least this long before candle close applies0

Close Offset

Exit slightly before the candle closes to avoid slippage at the boundary:

Offset: 120 seconds (2 minutes)
4H candle ends at 16:00 → trade closes at 15:58

Minimum Trade Age

Prevents closing trades that just opened near a candle boundary. If a trade is younger than the minimum age, the close rolls to the next candle:

Min Age: 5 minutes
Trade opened at 15:57, candle closes at 16:00 → too young (3 min < 5 min)
→ Rolled to close at 20:00 (next 4H candle)

Priority Rules

  • Trailing stop takes priority: If a trailing stop is active on a trade, candle close will not fire
  • Retroactive application: Enabling this on a bot with existing open trades will apply it to those trades immediately
  • Disabling: Turning this off removes the candle close schedule from any open trades that haven't triggered yet

Note: This setting works at the bot level. All entry trades from this bot will auto-close at candle boundaries. Strategies can also trigger candle close programmatically using td.trade.closeOnCandleClose().

Strategy Parameters

Each strategy has unique parameters. Common categories:

Indicator Settings

// RSI Example
RSI_PERIOD: 14        // Calculation period
RSI_OVERSOLD: 30      // Buy signal threshold
RSI_OVERBOUGHT: 70    // Sell signal threshold
// MACD Example
FAST_PERIOD: 12       // Fast EMA
SLOW_PERIOD: 26       // Slow EMA
SIGNAL_PERIOD: 9      // Signal line

Filter Settings

// Trend Filter
USE_TREND_FILTER: true    // Enable/disable
TREND_EMA_PERIOD: 50      // Trend EMA period
// Volume Filter
USE_VOLUME_FILTER: true   // Enable/disable
MIN_VOLUME_RATIO: 1.5     // Min volume vs average

Trade Settings

// Position Management
MAX_POSITIONS: 1          // Maximum concurrent
COOLDOWN_BARS: 3          // Bars between trades
PYRAMID_ENABLED: false    // Allow adding to position

Spin Configuration

Spin Interval

Adjust how frequently the bot runs:

Current TFRecommended SpinMin Tier
1D, 1W5 minutesFree
4H2-5 minutesFree/Pro
1H2 minutesPro
15M, 30M30 secondsTrader
5M30 secondsTrader
1M10 secondsWhale

Spin Timing

Immediate: Spin runs as soon as interval elapses

Candle Close: Spin runs after candle closes (more accurate signals)

Parameter Optimization

Optimization Process

  1. Baseline: Start with default parameters
  2. Backtest: Test current settings
  3. Adjust: Change ONE parameter
  4. Compare: Backtest new settings
  5. Iterate: Repeat until satisfied

What to Optimize

ParameterImpactOptimization Goal
Indicator periodsSignal frequencyBalance signals vs accuracy
ThresholdsEntry/exit timingReduce false signals
Stop lossRisk per tradeMinimize losses, avoid stops
Take profitProfit captureMaximize gains

Optimization Tips

  1. Change one thing at a time - Isolate variable impact
  2. Use sufficient data - Minimum 100 trades for statistics
  3. Avoid overfitting - Don't optimize for past data only
  4. Test out-of-sample - Validate on unseen data
  5. Consider market regimes - Settings may need adjustment

Saving Configuration

Save Changes

  1. Make your configuration changes
  2. Click Save button
  3. Bot will use new settings on next spin

Configuration History

View previous configurations:

  • Access settings history
  • Compare performance by config
  • Restore previous settings if needed

Configuration Templates

Conservative Template

Position Size: 25%
Leverage: 1-2x (futures)
Stop Loss: 3%
Take Profit: 6%
Timeframe: 4H or 1D

Moderate Template

Position Size: 50%
Leverage: 3-5x (futures)
Stop Loss: 2%
Take Profit: 4%
Timeframe: 1H or 4H

Aggressive Template

Position Size: 75%
Leverage: 5-10x (futures)
Stop Loss: 1.5%
Take Profit: 3%
Timeframe: 15M or 1H

Note: These are starting points. Always customize based on your strategy and risk tolerance.

Common Configuration Mistakes

Over-Optimization

Problem: Tuning parameters too precisely to past data Solution: Use out-of-sample testing, keep parameters reasonable

Ignoring Risk Management

Problem: No stop loss or excessive leverage Solution: Always use stop losses, limit leverage

Mismatched Timeframes

Problem: Strategy timeframe doesn't match spin interval Solution: Ensure spin interval ≤ strategy timeframe

Too Many Filters

Problem: Too many conditions prevent any trades Solution: Start simple, add filters gradually

Next Steps