Paper Mode Guide
Paper Mode Guide
Paper mode lets you run a fully functional grid bot against em tempo real market data sem placing actual orders or risking capital. It is the essential bridge between backtesting dados historicos and deploying with real money. Understanding what the simulation covers and what it does not te ajuda a interpret paper mode results correctly.
How Paper Mode Works Internally
When dry_run is set to true in seu bot configuration, the entire simulation engine activates. O bot runs o mesmo code path as a live bot with one critical difference: all order operations are routed atraves do simulation module em vez de o exchange API.
The simulation engine includes:
- SimAccount: Tracks a virtual account balance, margin, and positions. It starts with the capital you configure and updates as simulated trades execute.
- FillModel: Determines when simulated orders would fill based on em tempo real price data. A limit ordem de compra fills when the real market price drops to or below a ordem price.
- PriceFeedSim: Connects to o mesmo em tempo real WebSocket price feed as the live bot. Paper mode uses actual market prices, not synthetic data.
- SendOrderSim: Intercepts order calls and routes them to the simulation engine em vez de o exchange API.
The simulation runs the complete bot cycle: price checks, nivel de grid evaluation, order placement decisions, fill detection, TP management, and reconciliation. Every decision o bot makes is identical to live mode; only the execution layer differs.
What Paper Mode Simulates Accurately
Price-based decisions: Since paper mode uses em tempo real market prices, all decisions about which nivel de grids to buy, when to place TP orders, and when grid break triggers are identical to live trading.
Bot logic and timing: The full cycle runs at o mesmo interval. Reconciliation, bootstrap, grid break detection, and all safety guards operate exactly as they would in production.
Order placement logic: O bot decides to place orders using o mesmo filters: grid locks, pending levels, in-flight tracking, and duplicate detection all function normally.
PnL calculation: Realized and PnL nao realizado are calculated using o mesmo formulas as live mode, based on simulated fill prices and current market prices.
What Paper Mode Cannot Simulate
Slippage: In real markets, especially during volatility spikes, your ordem limites may fill at slightly different prices than specified. The simulation fills at the exact order price.
Partial fills: Real exchange orders can fill partially. The simulation always fills completely once o preco condition is met.
Order queue position: On a real exchange, your ordem limite competes with other orders at o mesmo price. You fill based on time priority. The simulation ignores livro de ordens depth and competition.
Funding rates: Perpetual futures charge funding every 8 hours based on the taxa de financiamento. Paper mode does not deduct these costs, which can be significant for positions held over multiple days.
Exchange latency: Real API calls take 50-500ms. The simulation responds instantly. Isso significa the paper mode bot may appear to fill orders slightly faster than a live bot would.
Interpreting Paper Mode Results
Given the limitations above, paper mode results tend to be slightly optimistic comparado com live performance. Expect your live results to be 10-20% lower than paper mode devido a:
- Slippage reducing effective profit per trade
- Partial fills requiring additional cycles to complete
- Funding rate costs accumulating over time
- Occasional API timeouts causing missed opportunities
Se vocer paper mode configuration is barely profitable (menos que 1% over several days), sera likely be unprofitable live. Look for configurations that show clear, comfortable profitability in paper mode before deploying.
Running a Paper Mode Test
To activate paper mode, set dry_run: true in seu bot configuration YAML:
execution:
dry_run: true
debug: false
Everything else in sua configuracao stays the same. O bot starts, connects to real price feeds, and begins its cycle. Monitor the dashboard and logs just as you would with a live bot.
Recommended test duration: Run paper mode for at least 3-5 days before going live. This gives you exposure to different condicoes de mercado including weekday volatility, weekend lulls, and at least one or two significant price moves.
Transitioning to Live Trading
Quando voce are satisfied with paper mode performance, transitioning to live is straightforward:
- Review your paper mode PnL and ensure it meets your expectations.
- Verify your exchange account has sufficient balance for the configured grid.
- Change
dry_run: falsein sua configuracao. - Start o bot. It will now place real orders on o exchange.
Importanteeee: Start live with o mesmo configuration you tested. Do not change nivel de grids, tamanho da ordem, or leverage during the transition. You want your live behavior to match what you validated in paper mode.
Depois der first live session (24-48 hours), compare live results against your paper mode results. If live performance is significantly worse (mais que 30% lower), investigate the cause before continuing. Common issues include higher-than-expected fees, slippage in thin markets, or taxa de financiamento costs that were not factored in.
Resumo
- Paper mode runs the full bot logic against em tempo real prices but routes orders through a simulation engine em vez de o exchange.
- Simulated results are slightly optimistic devido a perfect fills, no slippage, and no funding costs; expect 10-20% lower performance when live.
- Run paper mode for 3-5 days minimum, then transition to live with identical configuration settings.
Proximo Passo
Understand the complete bot architecture and internal cycle in How the Grid Bot Works.
✨ Este artigo foi util?
Faca suas perguntas no Discord →