# First Trading Bot

## Prerequisites

* [Account setup complete](https://quantsedge.gitbook.io/quantsedge-docs/getting-started/account-setup) - Wallet connected and funded
* Basic trading knowledge - [Order types](https://quantsedge.gitbook.io/quantsedge-docs/trading-fundamentals/order-types) and [risk management](https://quantsedge.gitbook.io/quantsedge-docs/trading-fundamentals/risk-management)
* 30-45 minutes for testing cycle

<figure><img src="https://76253325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKGlBOj0qewMsTgGp7icE%2Fuploads%2Fgit-blob-a480bda33e2a6c8bd857e0164342548973298310%2FScreenshot%202025-10-25%20at%2022.44.00.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## Four-Phase Process

```
Strategy Selection → Backtesting → Paper Trading → Live Deployment
     (5 min)           (2 min)        (5-7 days)      (optional)
```

## Phase 1: Strategy Selection (5 min)

**Navigate:** Strategy Lab → Launch Bot

**Choose a template:**

| Strategy           | Best For         | Risk        | Skill        |
| ------------------ | ---------------- | ----------- | ------------ |
| **Momentum**       | Trending markets | Medium      | Beginner     |
| **Mean Reversion** | Range-bound      | Medium-Low  | Beginner     |
| **Breakout**       | Volatile         | Medium-High | Intermediate |

**This tutorial:** Select **Momentum Strategy** → Use Template

**Configure settings:**

| Setting          | Recommended       | Example            |
| ---------------- | ----------------- | ------------------ |
| Bot Name         | Descriptive       | "BTC Momentum Bot" |
| Trading Pair     | Major pair        | BTC-USD            |
| Order Size       | Start small       | $200               |
| Leverage         | No leverage       | 1x                 |
| Take Profit      | 3-5%              | 4%                 |
| Stop Loss        | 1.5-2%            | 2%                 |
| Max Daily Trades | Limit overtrading | 3-5                |

**Strategy logic:** Entry when price crosses above 20-MA + RSI >50 + Volume confirmation. Exit at TP (4%) OR SL (2%) OR momentum weakens.

## Phase 2: Backtesting (2 min)

**Run backtest:**

1. Click **Run Backtest**
2. Set time period: Last 3-6 months
3. Starting capital: Your planned amount
4. Click **Start Backtest** (30-60 seconds)

**Key metrics to check:**

| Metric        | Good            | Excellent |
| ------------- | --------------- | --------- |
| Total Return  | 10-20% over 3mo | >20%      |
| Win Rate      | >45%            | >60%      |
| Profit Factor | >1.3            | >1.8      |
| Max Drawdown  | <15%            | <10%      |
| Sharpe Ratio  | >1.0            | >2.0      |

**Warning signs:**

* Drawdowns >25%
* Win rate >80% (over-optimized)
* All profits from 1-2 trades

**Good result example:** +12% return, 62% win rate, 1.8 profit factor → Proceed to paper trading

## Phase 3: Paper Trading (5-7 days)

**Why paper trade?**

* Tests real-time execution with actual market data
* Captures current market conditions that backtests cannot simulate
* Reveals actual slippage and timing issues that backtests cannot predict

**Start:**

1. Click **Deploy to Paper Trading**
2. Confirm configuration
3. Click **Start Paper Trading**

**Monitor daily:** Review open positions for proper management, check error logs for any issues, verify that trades make logical sense based on your strategy, and track overall P\&L performance for progress assessment.

**Don't:** Tweak settings constantly as this prevents proper strategy evaluation, stop after one loss or win as this doesn't provide sufficient data, or skip to live trading too quickly without proper validation.

**Run for 5-7 days minimum** to capture different market conditions.

**Evaluate after 5-7 days:**

* [ ] Total P\&L positive?
* [ ] Trades logical?
* [ ] Risk management working?
* [ ] No technical issues?
* [ ] Comfortable with drawdowns?

If all yes → Ready for live deployment

## Phase 4: Live Deployment (Optional)

**Pre-deployment checklist:**

* [ ] Backtest shows positive results
* [ ] Paper trading profitable 5-7 days
* [ ] Understand why strategy works
* [ ] Trading wallet funded
* [ ] Risk limits configured
* [ ] Accept potential losses
* [ ] Trading with affordable capital

**Deploy:**

1. Click **Deploy to Live Trading**
2. Review all settings
3. Confirm risks understood
4. Click **Deploy Live Bot**

**Start small:**

* Position size: 50% smaller than planned
* Leverage: 1x only
* Monitor: Check every few hours first 24h

**First week:** Conduct daily performance reviews to assess bot effectiveness, compare live results to backtest expectations for validation, track slippage and fees to understand real-world costs, and adjust parameters if significant deviations are observed.

**Scaling up (after 2-4 weeks success):**

1. Review performance
2. Confirm consistent profitability
3. Increase position size by 25-50%
4. Monitor 1-2 weeks
5. Repeat if performing well

**Limits:**

* Never risk >2% per trade
* Total bot exposure <20% of capital
* Multiple uncorrelated strategies preferred for diversification

## Managing Your Bot

| Action    | Effect                            | When to Use            |
| --------- | --------------------------------- | ---------------------- |
| **Pause** | Stops new trades, keeps positions | Break, volatile market |
| **Stop**  | Stops trading, closes positions   | Strategy not working   |
| **Edit**  | Modify settings (requires pause)  | Optimize parameters    |

**Pause immediately if:**

* Unexpected behavior
* Technical errors
* Performance worse than backtest expectations
* Don't understand what's happening

**Stop and reassess if:**

* Drawdown exceeds backtest maximum - indicates strategy failure
* Consistent losses for 2+ weeks - suggests market regime change
* Strategy broken in current market - requires strategy revision or pause

## Common Mistakes

**Skipping testing:** Always complete backtest → paper → live cycle

**Over-optimizing:** Simple strategies with some losses beat complex perfect backtests

**Position too large:** Start small (1-2% risk), scale gradually

**Max leverage:** Start 1x, increase slowly after profits

**Panic adjustments:** Set parameters, test, let run. Review weekly, not hourly.

## Key Takeaways

* Test before live trading (backtest → paper → live)
* Start small positions, low leverage
* Use stop losses every trade
* Monitor regularly, don't over-adjust
* Scale gradually after success
* Okay to pause or stop
* Never risk more than you can afford

***

**Your first bot is a learning experience.** Focus on process, not just profits. Small consistent gains beat risky big swings.
