8. Test Xerolite Order Execution (Safe Test)
Before using XeroLite with real money, it's crucial to test order execution in a safe environment. This section guides you through testing XeroLite with paper trading.
8.1: Enable Paper Trading Mode
Switch to Paper Trading Account
- Log in to Paper Trading Account:
- In TWS/IB Gateway, ensure you're logged into your Paper Trading account
- Paper Trading accounts allow you to test without real money
- If you don't have a paper trading account, create one in your IB account settings
Paper Trading Benefits
- Risk-Free Testing: Test strategies without financial risk
- Real Market Conditions: Uses real market data and conditions
- Full Feature Access: Test all XeroLite features safely
- Learning Opportunity: Understand order execution without consequences
8.2: Trigger a Test Signal
Create a Test Alert
- Use Alert Request Builder:
- In XeroLite, navigate to Alert Request Builder
- Build a simple test alert (see Alert Request Builder)
- Use a small quantity for testing (e.g., 1 share)
- Configure Test Alert:
- Select a common symbol (e.g., AAPL, MSFT)
- Set order type to MARKET for immediate execution
- Use a small quantity to minimize impact
- Set action to BUY or SELL
- Send Test Alert:
- Use the Test Place Order feature if available
- Or send a test alert from TradingView (if configured)
- Monitor the alert in XeroLite's incoming alerts log
Test Alert Example
{
"name": "TEST_ORDER_001",
"symbol": "AAPL",
"currency": "USD",
"asset_class": "STOCK",
"exch": "SMART",
"action": "BUY",
"qty": "1",
"order_type": "MARKET"
}
Monitor Alert Processing
- Check Incoming Alerts:
- Navigate to Incoming Alerts tab in XeroLite
- Verify your test alert appears in the log
- Check alert status (Success, Error, etc.)
- Review Alert Details:
- Click on the alert to see detailed information
- Verify all fields were parsed correctly
- Check for any validation errors
8.3: Confirm Order Sent to IB
Verify Order Execution
- Check Transaction Log:
- Navigate to Transactions tab in XeroLite
- Look for your test order in the transaction history
- Verify order status (Filled, Pending, Rejected, etc.)
- Verify in TWS:
- Open TWS and check the Orders tab
- Look for the order sent by XeroLite
- Verify order details match your alert (symbol, quantity, action)
- Check Execution:
- If using MARKET orders, execution should be immediate
- For LIMIT orders, check if order is pending or filled
- Verify fill price and execution time
Order Status Indicators
- Filled: Order executed successfully
- Pending: Order submitted and waiting
- Rejected: Order was rejected by IB
- Cancelled: Order was cancelled
Verify Order Details
Confirm the following match your test alert:
- ✅ Symbol: Correct stock symbol
- ✅ Action: BUY or SELL matches
- ✅ Quantity: Correct number of shares
- ✅ Order Type: MARKET, LIMIT, etc.
- ✅ Account: Correct IB account
Test Different Order Types
Once basic order execution works, test:
- Market Orders: Immediate execution
- Limit Orders: Orders at specific prices
- Stop Orders: Stop-loss functionality
- Bracket Orders: Orders with take-profit and stop-loss
Troubleshooting Test Orders
Order Not Appearing in TWS
- Check Connection: Verify XeroLite is connected to IB
- Check API Settings: Ensure API precautions are configured
- Check Order Log: Review XeroLite transaction log for errors
- Verify Account: Confirm you're using the correct IB account
Order Rejected
- Check Account Permissions: Ensure account allows trading
- Verify Symbol: Confirm symbol is valid and tradeable
- Check Market Hours: Some orders may be rejected outside market hours
- Review Error Messages: Check TWS for specific rejection reasons
Order Not Executing
- Market Orders: Should execute immediately during market hours
- Limit Orders: Will only execute if price reaches limit
- Check Market Status: Ensure markets are open
- Verify Quantity: Ensure quantity is valid (not too large)
Safety Reminders
- ✅ Always test with Paper Trading first
- ✅ Use small quantities for testing
- ✅ Verify order details before confirming
- ✅ Monitor first few orders closely
- ✅ Keep TWS visible to watch orders
Next Steps
After successfully testing order execution, proceed to:
- Prepare TradingView for Alerts – Set up TradingView alerts for automated trading
- Creating Alerts in TradingView – Learn how to create trading alerts
Need Help?
If you encounter issues during testing, contact support at [email protected]