{"version":"https://jsonfeed.org/version/1.1","title":"Pit Officer Blog","description":"Engineering articles about pre-trade risk, trading systems, and order controls.","language":"en","home_page_url":"https://pitofficer.com/blog/","feed_url":"https://pitofficer.com/blog/feed.json","authors":[{"name":"Pit Officer Team"}],"items":[{"id":"https://pitofficer.com/blog/api-order-rejected-insufficient-balance/","url":"https://pitofficer.com/blog/api-order-rejected-insufficient-balance/","title":"API order rejected for insufficient balance but you have enough","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"What a bot can spend is derived, not read: the free amount of the asset the order debits, in the wallet it debits, after venue holds and fees, from a snapshot that reflects the last balance change the bot knows of. When a field is missing or the snapshot may be older, the answer is unknown, not a number.","summary":"What a bot can spend is derived, not read: the free amount of the asset the order debits, in the wallet it debits, after venue holds and fees, from a snapshot that reflects the last balance change the bot knows of. When a field is missing or the snapshot may be older, the answer is unknown, not a number.","date_published":"2026-11-26T21:23:35+02:00","date_modified":"2026-11-26T21:23:35+02:00","tags":["order-validation","risk-controls","trading-bots","reconciliation"]},{"id":"https://pitofficer.com/blog/stop-loss-not-covering-partial-fill/","url":"https://pitofficer.com/blog/stop-loss-not-covering-partial-fill/","title":"Stop loss not covering your position after a partial fill","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"After a partial entry, a canceled remainder, a rejected child or a partial exit, the position can have no working stop, or one too large, and no venue message says so. After every event, compare armed stop quantity with the open position, and check separately that no exit can open the opposite position.","summary":"After a partial entry, a canceled remainder, a rejected child or a partial exit, the position can have no working stop, or one too large, and no venue message says so. After every event, compare armed stop quantity with the open position, and check separately that no exit can open the opposite position.","date_published":"2026-11-12T22:08:16+02:00","date_modified":"2026-11-12T22:08:16+02:00","tags":["risk-controls","order-management","trading-bots","stop-loss"]},{"id":"https://pitofficer.com/blog/pit-officer-0-3-0/","url":"https://pitofficer.com/blog/pit-officer-0-3-0/","title":"Pit Officer 0.2.1 and 0.3.0: live IBKR, Binance and eToro, open P&L limits","authors":[{"name":"Anna Palchukovsky","url":"https://www.linkedin.com/in/anna-palchukovsky/"}],"content_text":"Pit Officer 0.2.1 adds Interactive Brokers, Binance and eToro trading connections, live trading on every venue, a mode for trading from zero, and P&L bounds that count open positions; 0.3.0 adds live-account steps per venue. A breached bound rejects the next order and blocks new orders, exits included.","summary":"Pit Officer 0.2.1 adds Interactive Brokers, Binance and eToro trading connections, live trading on every venue, a mode for trading from zero, and P&L bounds that count open positions; 0.3.0 adds live-account steps per venue. A breached bound rejects the next order and blocks new orders, exits included.","date_published":"2026-11-06T22:30:46+02:00","date_modified":"2026-11-06T22:30:46+02:00","tags":["pit-officer","risk-controls","kill-switch","market-data","trading-bots"]},{"id":"https://pitofficer.com/blog/openpit-0-11-0/","url":"https://pitofficer.com/blog/openpit-0-11-0/","title":"OpenPit SDK 0.9.0 and 0.11.0: position ceilings and open P&L bounds","authors":[{"name":"Anna Palchukovsky","url":"https://www.linkedin.com/in/anna-palchukovsky/"}],"content_text":"Per-order caps and a realized-loss limit never see what the account holds. OpenPit SDK 0.9.0 adds a Spot Funds position limit per account and asset that counts working orders, in every SDK; 0.11.0 adds unrealized and total P&L bounds, set from Rust, C and Go, that block the account no later than its next order.","summary":"Per-order caps and a realized-loss limit never see what the account holds. OpenPit SDK 0.9.0 adds a Spot Funds position limit per account and asset that counts working orders, in every SDK; 0.11.0 adds unrealized and total P&L bounds, set from Rust, C and Go, that block the account no later than its next order.","date_published":"2026-11-02T21:20:18+02:00","date_modified":"2026-11-02T21:20:18+02:00","tags":["openpit","risk-controls","kill-switch"]},{"id":"https://pitofficer.com/blog/multiple-trading-bots-one-account/","url":"https://pitofficer.com/blog/multiple-trading-bots-one-account/","title":"Multiple trading bots on one account: sharing buying power","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"Two bots that check a shared balance and then send both pass when each check reads a balance that does not yet show the other's order. Check and reserve atomically at one admission point, persist the reservation before sending, and release it only on a terminal report, never on a cancel acknowledgment or a timeout.","summary":"Two bots that check a shared balance and then send both pass when each check reads a balance that does not yet show the other's order. Check and reserve atomically at one admission point, persist the reservation before sending, and release it only on a terminal report, never on a cancel acknowledgment or a timeout.","date_published":"2026-10-29T21:52:39+02:00","date_modified":"2026-10-29T21:52:39+02:00","tags":["order-validation","risk-controls","trading-bots","order-management"]},{"id":"https://pitofficer.com/blog/pit-officer-0-1-0/","url":"https://pitofficer.com/blog/pit-officer-0-1-0/","title":"Pit Officer 0.1.0: pre-trade risk checks outside your trading bot","authors":[{"name":"Anna Palchukovsky","url":"https://www.linkedin.com/in/anna-palchukovsky/"}],"content_text":"Pit Officer 0.1.0, the first beta, is a self-hosted service where the OpenPit engine checks every order before Officer sends it to Alpaca, whether it came from the web panel, trading software over REST or an AI agent over MCP. A rejected order sends nothing, and an agent cannot loosen the limits it trades under.","summary":"Pit Officer 0.1.0, the first beta, is a self-hosted service where the OpenPit engine checks every order before Officer sends it to Alpaca, whether it came from the web panel, trading software over REST or an AI agent over MCP. A rejected order sends nothing, and an agent cannot loosen the limits it trades under.","date_published":"2026-10-27T22:55:39+02:00","date_modified":"2026-10-27T22:55:39+02:00","tags":["pit-officer","risk-controls","kill-switch","trading-bots"]},{"id":"https://pitofficer.com/blog/trading-bot-crashed-open-position/","url":"https://pitofficer.com/blog/trading-bot-crashed-open-position/","title":"What happens if my trading bot crashes with a position open?","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"A kill switch inside the bot dies with the bot; its orders and position stay at the venue. A venue timer can cancel the protective stop with the entries, and a closing order can be throttled while cancels pass. Persist a halt that blocks new risk across restarts, allow only verified exits, and drill a crash on paper.","summary":"A kill switch inside the bot dies with the bot; its orders and position stay at the venue. A venue timer can cancel the protective stop with the entries, and a closing order can be throttled while cancels pass. Persist a halt that blocks new risk across restarts, allow only verified exits, and drill a crash on paper.","date_published":"2026-10-15T22:15:19+03:00","date_modified":"2026-10-15T22:15:19+03:00","tags":["risk-controls","kill-switch","trading-bots"]},{"id":"https://pitofficer.com/blog/stale-market-data-trading-bot/","url":"https://pitofficer.com/blog/stale-market-data-trading-bot/","title":"How to handle stale market data in a trading bot's loss limits","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"A loss limit is only as current as the oldest price in it. Measure each required price's age from its source time at decision time, tell a quiet market from a dead feed with heartbeats and sequence numbers, and while any price is stale treat P&L as unknown: no new exposure, verified risk-reducing orders only.","summary":"A loss limit is only as current as the oldest price in it. Measure each required price's age from its source time at decision time, tell a quiet market from a dead feed with heartbeats and sequence numbers, and while any price is stale treat P&L as unknown: no new exposure, verified risk-reducing orders only.","date_published":"2026-10-01T22:38:24+03:00","date_modified":"2026-10-01T22:38:24+03:00","tags":["risk-controls","market-data","trading-bots","websockets"]},{"id":"https://pitofficer.com/blog/duplicate-orders-after-timeout/","url":"https://pitofficer.com/blog/duplicate-orders-after-timeout/","title":"Trading bot duplicate orders after a timeout: did it fill?","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"A timeout after the send, an unknown-status error, an HTTP server error or an empty body leaves the outcome unknown. Keep its full size reserved until the order stream or a lookup by its ID finds it, or a person confirms it is absent. Never resend blindly: Binance accepts the same client order ID again after a fill.","summary":"A timeout after the send, an unknown-status error, an HTTP server error or an empty body leaves the outcome unknown. Keep its full size reserved until the order stream or a lookup by its ID finds it, or a person confirms it is absent. Never resend blindly: Binance accepts the same client order ID again after a fill.","date_published":"2026-09-17T22:17:02+03:00","date_modified":"2026-09-17T22:17:02+03:00","tags":["order-management","trading-bots","idempotency","risk-controls"]},{"id":"https://pitofficer.com/blog/openpit-0-8-0/","url":"https://pitofficer.com/blog/openpit-0-8-0/","title":"OpenPit 0.8: trades made outside the bot now reach its limits","authors":[{"name":"Anna Palchukovsky","url":"https://www.linkedin.com/in/anna-palchukovsky/"}],"content_text":"OpenPit SDK 0.8.0 adds drop copy in every SDK: an order executed outside the bot runs through the same policies with ordinary rejects ignored, and its fills follow as execution reports, so funds and loss limits count it. P&L bounds now carry a currency, and seven API changes need code edits.","summary":"OpenPit SDK 0.8.0 adds drop copy in every SDK: an order executed outside the bot runs through the same policies with ordinary rejects ignored, and its fills follow as execution reports, so funds and loss limits count it. P&L bounds now carry a currency, and seven API changes need code edits.","date_published":"2026-09-06T21:47:08+03:00","date_modified":"2026-09-06T21:47:08+03:00","tags":["openpit","reconciliation","risk-controls"]},{"id":"https://pitofficer.com/blog/trading-bot-position-out-of-sync-with-broker/","url":"https://pitofficer.com/blog/trading-bot-position-out-of-sync-with-broker/","title":"Why your trading bot's position drifts from the broker's","authors":[{"name":"Eugene Palchukovsky","url":"https://github.com/palchukovsky"}],"content_text":"A trading bot's position is the confirmed filled quantity plus the open quantity of every order without a final outcome. Track cumulative fills per order, rebuild after a reconnect by buffering the stream before the snapshot, and check new orders against the worst side of that range.","summary":"A trading bot's position is the confirmed filled quantity plus the open quantity of every order without a final outcome. Track cumulative fills per order, rebuild after a reconnect by buffering the stream before the snapshot, and check new orders against the worst side of that range.","date_published":"2026-09-03T21:25:26+03:00","date_modified":"2026-09-03T21:25:26+03:00","tags":["reconciliation","order-management","risk-controls","trading-bots"]}]}