HFTE Agent is an experimental open-source agent written in Rust. It compares a fast price feed with a slow trading account, raises a signal when a gap opens and, only if you enable it, sends an order to the slow account and closes it automatically.
Experimental software, provided as is, without warranty. Not financial advice.
LIVE_ORDERS=1 only on a demo account first, with the minimum lot size. You are responsible for every order it sends.From a quote to an automatic exit, in four stages.
Your local client program sends quotes, positions and order results to the agent over TCP on 127.0.0.1. The protocol is described in docs/PROTOCOL.md.
With a fast quote F and a slow quote S: buy_gap = F.bid - S.ask and sell_gap = S.bid - F.ask. A signal is raised when the larger gap reaches min_gap_pts.
A cooldown, a maximum slow spread, a freshness check on the slow quote and a maximum number of positions.
Live mode only: an order goes to the slow account, then closes on stop loss, take profit, trailing stop, gap convergence or maximum age.
You need a stable Rust toolchain. No prebuilt binaries are published.
# 1. Build and test cargo build --release cargo test # 2. Run from the folder that contains hfte-config.json (DRY mode) target/release/hfte-agent # 3. Orders: demo account only, minimum lot size LIVE_ORDERS=1 target/release/hfte-agent
| Variable | Default | Meaning |
|---|---|---|
LIVE_ORDERS | unset | Set to 1 to send orders. Anything else means DRY. |
AGENT_PORT | 9100 | TCP port on 127.0.0.1. |
PIN_CORE | unset | Index of the CPU core to pin the decision thread to. |
On Windows the binary is target\release\hfte-agent.exe. Configuration is described in docs/CONFIG.md. If you build and distribute your own executable, expect antivirus false positives on unsigned binaries.
We would rather you know before you build it.
Listed in the repository, repeated here.
Only gap-EURUSD is wired in. GBPUSD and USDJPY quotes are parsed but no setup uses them. Point size assumes 5-digit pairs and a 3-digit USDJPY.
Only quotes from the fast connection trigger a decision. Freshness is measured on arrival time and the timestamp sent by the client is ignored.
risk.daily_loss is read and validated but not enforced. max_positions counts every position the client reports, not only those opened by the agent.
No quote-freeze detection, no spread filter on the fast side (abnormal fast quotes around the daily rollover are not filtered) and no trading-hours window.
Automatic exits apply only to tickets opened by the agent during the current run, while the client keeps sending position reports. After a restart, existing positions are left to their stop loss.
After a disconnection of the trading client, the age of a position restarts from zero, so max_life restarts too. One demo order was once not closed by max_life in an internal build, cause unknown. Keep the stop loss on.
An invalid or missing configuration file makes the agent fall back to the defaults. It logs why.
This build has been tested against a scripted local client only. No live broker connection has been tested with it. The decision loop has no unit test yet.
DRY signals are based on quote arrival times: no slippage, no rejection, no last look. The core_us value is a diagnostic, not a latency. End-to-end latency has not been measured.
HFTE Agent is free and open source under the MIT license. The cloud console, the ready-to-use client and the support are part of Nexus HFTE and are not in this repository.
Research software, not investment advice. Trading leveraged products carries a high risk of loss. See our risk disclosure. The names "Nexus HFTE" and "Algotradingresearch" and any logo are not licensed under the MIT license.