TradeServer 4.0.7.132¶
Released 2026-10-30. All versions
Highlights¶
- Installs: each TradeServer now registers as an install on your account, and a license runs on one computer at a time. Starting it on a second computer shows "This license is in use by" with the name of the computer that has it, and it starts by itself as soon as the license is free
- Licenses page: haasonline.com/account/licenses shows the computer your license is running on, with Release to move the license to another computer
- Smart Trade: open a trade with a stop loss (fixed or trailing) and one or more take-profit targets, managed by the TradeServer; start one from Execute Trade, a balance row, or a price on the chart, or take over a position you already hold
- Order Overview: every open order and Smart Trade across your accounts on one page, with account and market filters, live PnL, Add buy/sell, Reduce and Close now, and a Smart Trade history with what closed at each exit
- Lots per spot market (Settings) and Orders widgets on the dashboard
Exchanges¶
- BloFin spot is now available for trading, with live prices and order updates over BloFin's new spot WebSocket
- OKX: WebSocket connections no longer use port 8443, which OKX shuts down on October 31; update before then to keep live prices and order updates
- Bybit EU (api.bybit.eu) is now its own exchange, "Bybit EU", with its own markets, lot sizes, fees and price feed
- HTX (formerly Huobi) USDT-M and COIN-M perpetual swaps are available again, rebuilt on HTX's current API, and Huobi is now shown as HTX everywhere
- OKX Futures is available again, including the X-Perp contracts used by OKX Europe accounts; OKX Europe (EEA) API keys are supported
- Removed: BitMEX spot and BitMEX derivatives, after the exchange settled its contracts and closed
- OKX: fixed spot market buys spending the order size as USDT instead of buying that amount of the coin
- OKX Swap and Futures: fractional contract sizes are no longer rounded down to zero, and the maximum order size is cut to the lot step instead of to whole contracts
- Bybit: spot market orders are sent as real market orders sized in the base coin; unified accounts stay tradable in isolated margin
- Bitget: market buys on spot buy the base amount asked for; UTA (v3) position updates no longer wipe the account's other positions; tokenized stock holdings are found in the wallet
- Bitget, Binance, KuCoin, WEEX: closing a position in hedge mode is now recorded as a close instead of a new position
- KuCoin: spot and futures fills are fetched as soon as the socket reports them, and a silent private socket is detected and refreshed
- Binance and Coinbase: trades are fetched as soon as the socket reports a fill
- Binance Futures: TradFi perpetual contracts are now listed; reduce-only exits can close positions below the minimum notional
- BloFin: a closed position leaves Open Positions within seconds instead of at the next 15-minute check, and each fill is listed once
- Kraken: fee rates are read correctly again after Kraken retired the old fee field; order lookups are faster and more reliable
- WEEX: spot market decimals follow each market's tick and step size; futures positions show the correct entry price; hedge mode is mapped correctly; a market not tradeable via the API is reported as such instead of as bad keys
- LBank Futures: handles the exchange's new asynchronous order acknowledgements and keeps order books updated correctly
- Phemex, WooX, HTX: more accurate error handling (insufficient funds is reported as such; lighter position polling on Phemex)
- Poloniex Futures: the unused Passphrase field and the fixed key lengths are gone, so current API keys are accepted
- Bitfinex: a "nonce: small" refusal that never clears (the key is being used by another program) is reported as a key error instead of retrying forever; insufficient balance is reported as such
- Bybit: spot "Insufficient balance" is reported as insufficient funds
Bots and trading¶
- Orders: a placed order now waits for its real outcome before being reported as failed, and an order that ends without a reason is looked up at the exchange
- Orders: an order the server could not route now says why instead of "Unknown reason"; amounts above the market maximum say so
- Bots: live bots are deactivated on start when the account's leverage differs from the bot's setting, instead of trading at the wrong leverage
- Bots: new bots default their trade amount to 1.5x the market minimum
- Bots: a bot's newest log page loads correctly, and a slow margin lookup on one account no longer holds up every bot
- Positions: fixed positions being archived twice when a script reuses a fixed positionId, and closed-position counts including archived positions twice
- Positions: managed positions above the market maximum are kept instead of being dropped as dust
- Bots: the leverage-mismatch message now points at the bot's own leverage setting
HaasScript¶
- New IsClosedCandleFinal tells a script whether the last closed candle is complete, and interval-cached indicators are rebuilt until it is
- Live bot scripts now have a per-update instruction budget; hitting the 50,000 instruction limit says so instead of "Circular reference detected"
- A script can now see positions on its account that its bot did not open
- Globals set on a bot's first tick survive a restart; dotted input labels keep their values across a recompile
- Fixed DynamicStopLoss/TakeProfit switching off after an entry, MaxLongAmount on spot, short-filled market orders counting as unfilled, and trailing stops inheriting an old peak when a positionId is reused
- SignalExitLong/SignalExitShort exit only the named side; SetLeverage re-margins open positions; GetPositionDirection returns NoPosition for a closed position; GetPositionROI accepts a target price
- Fixed Change, CrossOverSince/CrossUnderSince, ArrayGet/ArrayIndex, ArrayConcat, ArrayRemove, InputTable, ParseJson (top-level arrays), DelaySignal, CustomReport and Save (exactly 10,000 keys allowed)
- ParseCsv reads local files and header names correctly on self-hosted installs
- Bad input to math and TA helpers no longer aborts the script, and runtime errors are clearer (bracket assignment into a series, out-of-range series reads, compile errors without empty duplicates)
- When a saved value cannot be read, Load stops that run and logs why instead of continuing with (and saving) the default; values read back are cached, so fewer reads are needed
Backtests and charts¶
- Charts: the realized-profit chart no longer counts recent closed positions twice; scroll-back stops cleanly at the market's first candle; script panes with Height 1 size themselves automatically; PlotShape markers sit correctly above and below candles
- Backtests: backtests now refuse orders the wallet cannot cover and apply the plan's open-order limit, matching live bots; SetFee is applied in backtests
- Backtests and labs: no longer publish signals to the live signal store; a lab's combination count is checked before it starts building them
- Backtest charts: jump to a date, or to an order from the history
- Backtests: a backtest stopped by a restart reports why it ended instead of showing 100%
Platform¶
- Installs: restarting TradeServer on the same computer is accepted right away, even after a crash or a closed window
- Windows: fixed the TradeServer closing immediately at startup on newer Intel and AMD processors (hardware-enforced stack protection); the Exploit Protection workaround is no longer needed
- Linux: fixed "Fatal - no IPv4 address" stopping the server from starting on machines with IPv6 enabled; IPv6 no longer needs to be disabled
- MCP: add_script accepts "Command" as a script type
- Settings: settings.env values that contain "=" are no longer cut off
- Security: requests that carry no login are refused on every non-public API channel