CAI Terminal — User Guide
Exchange: Bybit (Linear Perpetual Futures)
Website: caiterminalapp.com
Back to CAI Terminal main page
Table of Contents
- Overview
- System Requirements
- Installation & First Launch
- Login
- Main Interface Overview
- Settings
- Creating Orders
- Managing Active Positions
- Managing Limit Orders
- Risk Management System
- Analytics (Trade History)
- Statistics Panel
- Sub-Accounts Selection
- Auto-Refresh & Status Bar
- Automatic Updates
- Security
- Configuration File Reference
- Troubleshooting
- Glossary
1. Overview
CAI Terminal is a desktop trading terminal for the Bybit cryptocurrency exchange. It allows you to:
- Manage multiple sub-accounts from a single interface
- Place market and limit orders on USDT-settled linear perpetual futures
- Set and manage Take Profit (main & partial) and Stop Loss levels
- Monitor active positions and pending limit orders in real time
- Enforce per-account risk management rules (daily loss limits, trade caps, losing-days cooldown)
- Auto-adjust position sizing based on remaining daily risk budget
- View weekly and monthly PnL statistics
- Analyze closed trade history with win-rate calculations
- Automatically refresh positions at configurable intervals
- Broadcast order actions across all selected sub-accounts simultaneously
2. System Requirements
| Requirement | Minimum |
|---|---|
| Operating System | Windows 10 / 11 (x64) |
| Runtime | .NET 8 Desktop Runtime |
| Internet | Required (connects to Bybit API) |
| Screen Resolution | 1920 × 1080 recommended |
3. Installation & First Launch
- Download the latest release from the CAI Terminal website.
- Extract the archive to any folder (e.g.,
C:\CAITerminal). - Ensure
appsettings.jsonis present in the same directory as the executable. - Double-click CAITerminal.exe to launch.
On first launch you will be prompted to log in (see Login).
4. Login
When the application starts, a Login dialog appears:
| Field | Description |
|---|---|
| Telegram ID | Your Telegram user ID used for authentication. Saved automatically after the first login so you don't need to re-enter it. |
| PIN | Your personal access PIN. Required every time you launch the application. |
- Press Enter to submit.
- Press Escape to cancel and exit the application.
appsettings.json. Never share your PIN.5. Main Interface Overview
After login, the main window opens with the following layout:
Main Tabs
| Tab | Description |
|---|---|
| Active Positions | All open positions across all sub-accounts. |
| Limit Orders | All pending limit/conditional orders. |
| Analytics | Closed trade history for a selected sub-account and date range. |
Menu Bar
| Menu Item | Description |
|---|---|
| Settings | Opens the Settings dialog. |
| Refresh | Manually refreshes positions, limit orders, and statistics. |
| Check for Updates | Checks for a newer version of the application. |
| User Guide | Opens the online user guide in your browser. |
| Close Terminal | Exits the application. |
6. Settings
Open settings via the menu bar → Settings.
6.1 General & Trading Settings
| Setting | Description | Default |
|---|---|---|
| Category | Trading category. Currently only linear (USDT perpetual futures). | linear |
| Settle Coin | Settlement currency: USDT or USDC. | USDT |
| Time In Force | Order TIF policy: IOC, GTC, FOK. | IOC |
| SL/TP Trigger | Price type for SL/TP triggers: MarkPrice, LastPrice, or IndexPrice. | MarkPrice |
| Leverage | Default leverage for all new orders (1–125×). | 10 |
| Risk Percents | Selectable risk multipliers for order sizing (e.g., 100%, 75%, 50%, 25%). | 100, 75, 50, 25 |
| Use Market as Limit | When enabled, market orders are sent as limit orders with a price offset to reduce fees. | false |
| Tick Size For Limit Order | Number of tick-size increments to offset price when "Use Market as Limit" is on. | 3 |
| Set Main TP On All Positions | Broadcast main Take Profit to the same symbol on all sub-accounts. | false |
| Set Main SL On All Positions | Broadcast main Stop Loss to the same symbol on all sub-accounts. | false |
| Add Partial TP On All Positions | Broadcast partial TP across all sub-accounts (only % and price shown). | true |
| Cancel Limit Orders On Position Close | When cancelling a limit order, also cancel all limit orders for that symbol across sub-accounts. | true |
| Positions Refresh Interval (sec) | Auto-refresh interval in seconds. Range: 5–3600. | 300 |
Click Save to persist. Settings are written to appsettings.json.
6.2 Sub-Accounts
Navigate to the Sub-Accounts tab in Settings. Each sub-account represents one Bybit API key pair.
Add a Sub-Account
- Click Add.
- Fill in the fields:
| Field | Description |
|---|---|
| Exchange Name | Currently only Bybit. |
| Environment | live (real trading) or demo (testnet). |
| Use In New Order | If checked, this account participates when you place a new order. |
| Name | A short identifier (e.g., "Main Account", "Strategy A"). |
| Description | Optional longer description. |
| API Key | Your Bybit API key. |
| API Secret | Your Bybit API secret. |
| Order Amount (USDT) | Base order size (see Order Sizing). |
| Use Amount as SL Amount | Treat Order Amount as risk (max loss) amount — see Order Sizing. |
| Max Trades Per Day | Maximum number of trades (open + closed) allowed per day. |
- Click Save. API keys are encrypted with your PIN before being stored.
Edit / Delete a Sub-Account
- Select a row and click Edit or Delete.
- Deleting requires confirmation.
6.3 Risk Management (Per Sub-Account)
Each sub-account has its own risk management configuration inside the RiskManagement section. This is configured in appsettings.json directly or through the Sub-Account editor. See Risk Management System for full details.
7. Creating Orders
- Click the Create New Order button on the right side.
- Risk management checks run automatically for all sub-accounts before the order form opens. Accounts that fail are unchecked and a summary is shown.
- The order creation panel appears.
7.1 Market Orders
- Check Market Order.
- The entry price auto-fills with the current market price.
- The order executes at (or near) the current market price.
7.2 Limit Orders
- Check Limit Order.
- Enter your desired Entry Price.
- If price hasn't been reached yet, a conditional (trigger) order is created:
- Long: if market < entry → triggers when price rises to entry.
- Short: if market > entry → triggers when price falls to entry.
7.3 Direction (Long / Short)
- Click Long (green) to go long / buy.
- Click Short (red) to go short / sell.
- The Place Order button updates: "Buy Market", "Sell Limit", etc.
7.4 Risk Percent
Select a Risk Percent from the dropdown. This scales the sub-account's Order Amount:
- 100% = full amount
- 50% = half
- etc.
Only percentages enabled in Settings appear.
7.5 Stop Loss & Take Profit on Order Creation
Optionally set Stop Loss and Take Profit directly on the order.
Validation:
- Long: SL must be below entry price.
- Short: SL must be above entry price.
- SL = 0 means no stop loss is set.
7.6 Order Sizing: Standard vs. SL-Based
There are two modes per sub-account, controlled by UseOrderAmountAsStopLossAmount.
Standard Mode (UseOrderAmountAsStopLossAmount = false)
The Order Amount is used directly as the notional value.
SL-Based (Risk) Mode (UseOrderAmountAsStopLossAmount = true)
This ensures that if Stop Loss is hit, the maximum loss equals the Risk Amount. Requires a Stop Loss to be set.
If Auto-Adjust Risk to Remaining Daily Limit is enabled, the Risk Amount is further capped at the remaining daily risk budget (see section 10.4).
Placing the Order
Click Place Order. The order broadcasts to all checked sub-accounts.
8. Managing Active Positions
8.1 Positions Grid
The Active Positions tab displays all open positions grouped by sub-account:
| Column | Description |
|---|---|
| +/− | Expand/collapse to see partial Take Profit orders. |
| Subaccount | Sub-account name (group header). Hover to see balance. |
| Symbol | Trading pair (e.g., BTCUSDT). |
| Direction | Long (green) or Short (red). |
| Qty | Position size. |
| Entry Price | Average entry price. |
| Stop Loss | Current SL price (or "−"). |
| Take Profit | Current main TP price (or "−"). |
| Projected PnL | Estimated PnL if main TP is hit. |
| PnL | Current unrealized P&L (green = profit, red = loss). |
| Close | Button to open the Close Position panel. |
Right-click on any position row to open the context menu:
| Menu Item | Action |
|---|---|
| Add Take Profit | Open the Partial TP panel. |
| Main Take Profit | Set/change the main TP. |
| Main Stop Loss | Set/change the main SL. |
| Close Position | Open the Close Position panel. |
8.2 Set Main Take Profit
- Right-click → Main Take Profit.
- Enter the TP price.
- Click Set Take Profit.
If Set Main TP On All Positions is enabled, the TP is applied to the same symbol/direction on all sub-accounts.
8.3 Set Main Stop Loss
- Right-click → Main Stop Loss.
- Enter the SL price.
- Click Set Stop Loss.
Same broadcast logic as TP when "Set Main SL On All Positions" is enabled.
8.4 Add Partial Take Profit
Partial TPs close a portion of your position at a specified price.
- Right-click → Add Take Profit.
- The panel shows:
- Entry Price (read-only)
- Total Quantity — remaining quantity not assigned to partial TPs
- Quantity — amount to take profit on (adjustable via slider 0–100% or manual input)
- Take Profit Price
- Profit — estimated profit (auto-calculated)
- Click Set Partial TP.
Validation:
- Long: TP must be above entry. Short: TP must be below entry.
- TP cannot be zero.
If Add Partial TP On All Positions is enabled, only the % slider and TP price are shown; quantity is calculated per sub-account individually.
8.5 Close Position
- Right-click → Close Position, or click the Close button in the grid.
- Adjust the quantity via slider (0–100%) or manual entry.
- Estimated PnL is shown based on last price.
- Click Close Position → confirm with Yes.
A market close order is placed for the specified quantity.
8.6 Expand Position Details
Click + on a position row to query all partial Take Profit orders:
| Column | Description |
|---|---|
| TP # | Sequential number. |
| Qty | Quantity for this TP. |
| Price | Trigger price. |
| Profit | Projected profit. |
| Delete | Cancel this partial TP order. |
Click − to collapse.
8.7 Sub-Account Balance Tooltip
Hover over a sub-account header row. After ~250ms, a tooltip shows:
- Available Balance (settle coin)
- Wallet Balance (settle coin)
Fetched live from Bybit.
9. Managing Limit Orders
9.1 Limit Orders Grid
| Column | Description |
|---|---|
| Subaccount | Sub-account name. |
| Symbol | Trading pair. |
| Direction | Buy or Sell. |
| Qty | Order quantity. |
| Trigger % | Distance from current price to trigger (%). |
| Entry Price | Limit/trigger price. |
| Stop Loss | SL on order (or "−"). |
| Take Profit | TP on order (or "−"). |
| Cancel | Button to cancel the order. |
9.2 Set TP / SL on Limit Orders
- Right-click → Take Profit or Stop Loss.
- Enter the price → click the button.
This modifies the existing order on Bybit.
9.3 Cancel a Limit Order
Click Cancel on the row, or right-click → Cancel Order.
If Cancel Limit Orders On Position Close is enabled and multiple limit orders exist for the same symbol, you'll be prompted to cancel all of them at once.
10. Risk Management System
CAI Terminal includes a comprehensive per-sub-account risk management system that runs automatically before every order creation. When you click "Create New Order", the system checks each sub-account and disables (unchecks) any that violate the rules.
10.1 Daily Loss Limit
Controls how much you can lose in a single trading day.
| Setting | Description |
|---|---|
DailyLoss.Enabled | Enable/disable daily loss checking. Default: true. |
DailyLoss.Type | "Amount" — fixed dollar limit. "Percent" — percentage of wallet balance. |
DailyLoss.Amount | Maximum daily loss in USDT (when Type = Amount). Default: 100. |
DailyLoss.PercentOfBalance | Maximum daily loss as % of wallet (when Type = Percent). Default: 1. |
DailyLoss.MaxLosingTradesPerDay | Max number of losing trades allowed per day. Default: 3. |
Example: If Type = "Amount" and Amount = 100, and your closed PnL today is −$105, the account is disabled.
10.2 Maximum Trades Per Day
| Setting | Description |
|---|---|
MaxTradesPerDay | Total trades allowed per day (closed + open positions + open limit orders). Default: 5. |
Example: If you have 2 closed trades, 2 open positions, and 1 open limit order = 5 total. No more orders can be placed.
10.3 Losing Days Protection
Prevents trading after consecutive losing days.
| Setting | Description |
|---|---|
LosingDaysProtection.Enabled | Enable/disable. Default: true. |
MaxConsecutiveLosingDays | Trigger after this many consecutive losing days. Default: 3. |
CooldownDays | Days to wait before trading resumes. Default: 2. |
10.4 Auto-Adjust Risk to Remaining Daily Limit
| Setting | Description |
|---|---|
AutoAdjustRiskToRemainingDailyLimit | When enabled, the risk amount per trade is automatically reduced if the remaining daily budget is less than the configured order amount. Default: true. |
How it works:
- The system calculates:
Remaining Risk = Allowed Daily Loss − |Today's Realized Loss| - If
Remaining Risk < Risk Amount, theRisk Amountis capped toRemaining Risk - If
Remaining Risk ≤ 0, the order is blocked entirely
10.5 How Risk Checks Work
When you click Create New Order:
- ✅ Daily Loss check — Has today's PnL exceeded the limit?
- ✅ Max Losing Trades — Have you hit the max losing trades for today?
- ✅ Max Trades Per Day — Have you reached the total trade cap (closed + open + limit)?
- ✅ Losing Days Protection — Are you in a consecutive-loss cooldown period?
If any check fails for a sub-account:
- The account is unchecked in the Sub-Accounts list
UseInNewOrderis set tofalseand saved- A summary dialog shows all restrictions
11. Analytics (Trade History)
- Switch to the Analytics tab.
- Select a sub-account (only one at a time).
- Set From and To dates.
- Click Get Trades.
The grid shows closed trades grouped by Symbol + Entry Price:
| Column | Description |
|---|---|
| Symbol | Trading pair. |
| Created Date | When opened. |
| Closed Date | When closed. |
| Direction | Long or Short. |
| Order Qty | Total closed quantity. |
| Avg Entry Price | Average entry. |
| PnL | Realized P&L (green/red). |
Statistics update to show:
- Total PnL for the date range
- Win Rate — wins / (wins + losses)
- Weekly PnL — current week
- Monthly PnL — current month
12. Statistics Panel
Located on the right side, always visible:
| Label | Description |
|---|---|
| Open Positions PnL | Total unrealized PnL across all positions/sub-accounts. |
| Positions # | Number of open positions. |
| Weekly PnL | Total realized PnL this week (Monday–now). |
| Monthly PnL | Total realized PnL this month. |
Click any label to manually refresh.
13. Sub-Accounts Selection
On the right panel, the Sub-Accounts tab shows a checklist:
- Check = include when placing new orders or broadcasting TP/SL
- Uncheck = exclude
- Select All checkbox for bulk toggle
Header shows count: Sub-Accounts (3/5) = 3 of 5 selected.
Changes are saved to appsettings.json immediately.
14. Auto-Refresh & Status Bar
Auto-Refresh
Positions, limit orders, and statistics refresh automatically at the configured interval (default: 300 seconds).
Status Bar
Next refresh in: XXs— countdown to next refresh- Notification area — last action or error message
- Hover over notifications to see a scrollable history log (last 200 entries with timestamps)
- Error messages appear in red
15. Automatic Updates
On startup, the application checks for a newer version. If found:
- Title bar shows:
CAI Terminal - v1.0.1 | New version available: X.X.X - A dialog prompts to visit the download page
- Click Yes to open in browser
Manual check: menu → Check for Updates.
16. Security
- API Key Encryption: Keys are encrypted using AES-256-GCM with a key derived from your PIN (PBKDF2, 100,000 iterations). Stored as Base64 in
appsettings.json. - PIN: Held in memory only during the session. Never written to disk.
- Telegram ID: Used for server-side authentication. Stored in plaintext.
appsettings.json file — it contains encrypted API credentials.17. Configuration File Reference
All settings are in appsettings.json.
Full Settings Reference
| Path | Type | Description |
|---|---|---|
PositionsRefreshIntervalSeconds | int | Auto-refresh interval (5–3600). |
Trading.Category | string | Product category (linear). |
Trading.SettleCoin | string | USDT or USDC. |
Trading.TimeInForce | string | IOC, GTC, or FOK. |
Trading.SLTPTrigger | string | MarkPrice, LastPrice, IndexPrice. |
Trading.Leverage | int | Default leverage (1–125). |
Trading.RiskPercents | int[] | Available risk multipliers. |
Trading.UseMarketOrderAsLimitOrder | bool | Send market as limit with offset. |
Trading.TickSizeForLimitOrder | int | Tick offset for market-as-limit. |
Trading.SetMainTPOnAllPositions | bool | Broadcast main TP to all sub-accounts. |
Trading.SetMainSLOnAllPositions | bool | Broadcast main SL to all sub-accounts. |
Trading.AddPartialTPOnAllPositions | bool | Broadcast partial TP to all sub-accounts. |
Trading.CancelLimitOrdersOnPositionClose | bool | Batch-cancel same-symbol limit orders. |
SubAccounts[].Environment | string | live or demo. |
SubAccounts[].UseInNewOrder | bool | Include in order broadcast. |
SubAccounts[].RiskManagement.OrderAmount | decimal | Base order/risk amount (USDT). |
SubAccounts[].RiskManagement.UseOrderAmountAsStopLossAmount | bool | SL-based sizing mode. |
SubAccounts[].RiskManagement.AutoAdjustRiskToRemainingDailyLimit | bool | Cap risk to daily budget. |
SubAccounts[].RiskManagement.MaxTradesPerDay | int | Max trades per day. |
SubAccounts[].RiskManagement.DailyLoss.Enabled | bool | Enable daily loss limit. |
SubAccounts[].RiskManagement.DailyLoss.Type | string | Amount or Percent. |
SubAccounts[].RiskManagement.DailyLoss.Amount | decimal | Fixed daily loss limit ($). |
SubAccounts[].RiskManagement.DailyLoss.PercentOfBalance | decimal | Daily loss as % of wallet. |
SubAccounts[].RiskManagement.DailyLoss.MaxLosingTradesPerDay | int | Max losing trades per day. |
SubAccounts[].RiskManagement.LosingDaysProtection.Enabled | bool | Enable losing-days cooldown. |
SubAccounts[].RiskManagement.LosingDaysProtection.MaxConsecutiveLosingDays | int | Trigger threshold. |
SubAccounts[].RiskManagement.LosingDaysProtection.CooldownDays | int | Cooldown period. |
Security.TelegramId | string | Telegram user ID for auth. |
18. Troubleshooting
| Problem | Solution |
|---|---|
| Login fails | Verify Telegram ID and PIN. Check internet connectivity. |
| "Failed to get positions/orders" | Check API keys, permissions (Trade, Read), and Environment (live vs demo). |
| "Set leverage failed" | Symbol may not support the configured leverage. Reduce in Settings. |
| "Order quantity is TOO SMALL" | Increase Order Amount in Sub-Account settings. |
| "Stop Loss Required" | Account uses SL-based sizing. Set a Stop Loss before placing the order. |
| "No remaining daily risk budget" | Daily loss limit reached. Wait until tomorrow or increase the limit in settings. |
| Sub-account keeps getting unchecked | Risk management rules are blocking it. Check Daily Loss, Max Trades, and Losing Days settings. |
| "Trades today reached limit" | Max Trades Per Day includes open positions + open limit orders + closed trades. |
| Positions not updating | Check countdown in status bar. Click PnL label to force refresh. |
| API keys appear garbled | Keys are encrypted. Re-enter in Sub-Account editor if PIN changed. |
| Application won't start | Ensure .NET 8 Desktop Runtime is installed. Verify appsettings.json is valid JSON. |
19. Glossary
| Term | Definition |
|---|---|
| Linear Perpetual | A futures contract settled in USDT/USDC with no expiry date. |
| Long | A position that profits when price rises. |
| Short | A position that profits when price falls. |
| Take Profit (TP) | Auto-closes position at a profitable price. |
| Stop Loss (SL) | Auto-closes position to limit losses. |
| Partial Take Profit | Closes only a portion of the position at a price. |
| PnL | Profit and Loss. |
| Leverage | Multiplier amplifying gains and losses. |
| Mark Price | Fair-value price calculated by exchange, prevents manipulation. |
| IOC | Immediate-Or-Cancel: fill what you can, cancel the rest. |
| GTC | Good-Till-Cancel: stays active until filled or cancelled. |
| FOK | Fill-Or-Kill: must fill entirely or not at all. |
| Trigger/Conditional Order | Activates only when price reaches a trigger level. |
| Tick Size | Minimum price increment for a trading pair. |
| Daily Loss Limit | Max allowed realized loss per day before trading is blocked. |
| Cooldown | Forced waiting period after consecutive losing days. |
| Risk Budget | Remaining daily loss allowance = Daily Limit − Today's Losses. |