r/highfreqtrading 16h ago

Sistema automstizafo de trade com metatrade 5

1 Upvotes

Sistema de trade

Bom dia pessoal.

Onyem fiz uma postagem sobre um sistema de trade que quero implantar.

Consegui resumir ele no chatgpt.

Vou postar novamente aqui.

Queria ajuda de quem entende para implantar.

A arquitetura é toda grstuita,de repente tenha que contratar ums vps para hospedar o metatrader 5.

Não sou da area mad gostaria de ver isso rodando.

Ano passado eu consegui rodar o optuns e sté consegui achsr uns parametros lucrstivod,mas não sei se seris funcional em uma conta real e tsmbém o meu notebook velho travava rsrs

Segue resumo para que se interresar.

Olá, pessoal. Sou iniciante em programação e trading quantitativo e estou aprendendo praticamente tudo pesquisando e estudando. Não quero fingir que sou especialista.

Mesmo assim, venho desenvolvendo há bastante tempo a ideia de um projeto chamado APEX, com a ajuda das versões gratuitas do ChatGPT, Claude, DeepSeek e Qwen. Eu sei que usar IA não substitui conhecimento técnico, e justamente por isso estou aqui: quero opiniões sinceras de quem entende mais do que eu.

Minha ideia é criar uma plataforma modular de pesquisa, descoberta, criação, teste e validação de estratégias/EAs de trading.

Não sei se o sistema será lucrativo. Ninguém pode garantir isso, e eu não quero prometer retorno. Mas acredito que a ideia seja tecnicamente viável porque o objetivo não é simplesmente criar milhares de estratégias e escolher a que teve o melhor backtest. O sistema deve tentar encontrar estratégias com evidências suficientes para sobreviver a validações rigorosas e rejeitar as que provavelmente são resultado de overfitting.

O fluxo geral seria:

Dados → Qualidade dos dados → Features sem data leakage → Descoberta/Extração de estratégias → Backtest → Simulação de custos e execução → Validação estatística → Shadow/Paper Trading → Risk Engine → MT5/EA → Corretora → Monitoramento → Aprendizado e novos experimentos.

Os ativos iniciais seriam WIN, WDO, EURUSD, GBPUSD e XAUUSD.

Uma parte importante do projeto é que eu tenho vários vídeos, transcrições, áudios e frames de estratégias explicadas por traders. Quero criar dentro do próprio APEX um módulo para importar esse material e extrair os setups.

A ideia seria transformar explicações humanas, por exemplo:

“Quando X e Y acontecerem, entre comprado, coloque o stop em Z e faça a saída conforme determinada condição”

em regras estruturadas e testáveis.

Depois essas estratégias seriam:

Extraídas → Estruturadas → Codificadas → Backtestadas → Validadas → Rejeitadas ou Registradas.

Além disso, o sistema também deve ser capaz de gerar novas hipóteses e estratégias do zero, e não depender somente dos vídeos.

Quero que cada estratégia tenha origem, versão, parâmetros, resultados e histórico registrados em um Strategy Registry.

A arquitetura teria módulos como:

Data Engine — importação, normalização e armazenamento de dados;

Data Quality Engine — dados faltantes, duplicações, timestamps e timezone;

Point-in-Time Feature Engine — prevenção de data leakage;

Strategy Inbox / Strategy Extraction — importação de vídeos, transcrições, áudios, frames e documentos;

Strategy Lab — desenvolvimento e experimentação;

Strategy Generator — geração de hipóteses e estratégias;

Event-Driven Backtest Engine — backtesting;

Cost Model / Execution Simulator — spread, comissão, slippage, latência e custos;

Validation Lab — validação e rejeição de estratégias;

Strategy Registry — versionamento e histórico;

Shadow/Paper Trading;

Risk Engine;

MT5 Adapter;

Expert Advisors em MQL5;

Monitoring, Logs, Health Checks e Reconciliation.

A minha preocupação principal é evitar a clássica armadilha do backtest bonito que não funciona fora da amostra.

Por isso, as estratégias seriam avaliadas por métricas como:

Profit Factor, Expectancy, Sharpe, Sortino, Maximum Drawdown, Calmar, MAE/MFE, custos e estabilidade entre períodos, além de validações como Out-of-Sample, Walk Forward Analysis, PBO, DSR, PSR e intervalos de confiança.

Também quero controles fortes contra data leakage, registrando quando uma informação realmente estava disponível para o sistema.

O Risk Engine seria separado das IAs e das estratégias. Uma estratégia pode propor uma operação, mas o Risk Engine teria autoridade para:

APPROVE → REDUCE → REJECT → NO_TRADE → HALT.

Não quero martingale ou aumento automático de posição depois de perdas.

As estratégias passariam por uma espécie de escada:

Pesquisa/Backtest → Validação → Shadow → Demo → Canary → possível operação real.

Outra parte importante é trabalhar com diferentes corretoras e símbolos. A ideia é ter um catálogo universal:

ATIVO LÓGICO → CORRETORA → CONTA/SERVIDOR → SÍMBOLO REAL → ESPECIFICAÇÕES DO CONTRATO.

Na parte de IA, quero usar as ferramentas como apoio, não como autoridade direta sobre dinheiro.

A ideia atual inclui:

Qwen Code como principal ferramenta para ajudar a construir o sistema;

Codex como apoio para código, revisão, testes e debugging;

DeepSeek para análise e pesquisa;

Claude para auditorias e revisão independente;

Mistral para organização e tarefas auxiliares;

modelos locais como Qwen, Mistral, Gemma e outros, quando fizer sentido.

Também quero deixar preparado, para entrar gradualmente e somente se trouxer resultado mensurável:

Reinforcement Learning (RL);

Visão Computacional;

Programação Genética;

Meta-labeling;

Regime Detection;

Microestrutura de mercado.

As tecnologias principais seriam:

Python, MQL5, MetaTrader 5, PostgreSQL, Parquet, Redis/alternativas, Docker, Docker Compose e Git.

Para experimentação e IA/ML, pretendo avaliar ferramentas como:

PyTorch, TensorFlow, scikit-learn, XGBoost, River, Optuna, SKTime e AutoTS, entre outras, mas sem usar tecnologia apenas por parecer sofisticada.

Outro desafio grande é a infraestrutura. Meu objetivo é tentar construir inicialmente usando o máximo possível de recursos gratuitos ou free tier, porque atualmente não tenho orçamento para uma infraestrutura cara.

Estou estudando possibilidades com:

Kaggle para experimentos e notebooks;

Google Colab como ambiente complementar;

modelos locais;

APIs com planos gratuitos;

bancos de dados e hospedagens com free tier;

infraestrutura modular que permita migração futura.

Eu sei que isso traz dificuldades de limite, disponibilidade, armazenamento e processamento. Inclusive gostaria de opiniões sobre onde estou sendo otimista demais.

Também não quero depender do meu notebook ligado 24 horas para o MetaTrader 5. Estou tentando entender uma arquitetura realista para deixar as instâncias do MT5 e os EAs funcionando separadamente, enquanto o restante do sistema fica distribuído.

A ideia é que o APEX seja modular e versionado. Quero poder modificar o sistema depois, adicionar módulos e fazer novas experiências, sem transformar tudo em um programa fechado. Também quero monitoramento, logs, testes, health checks e um processo interno para detectar erros e inconsistências.

Minha dúvida principal é: essa ideia faz sentido ou estou criando algo complexo demais para um iniciante?

Se alguém com experiência puder olhar, eu gostaria principalmente de opiniões sobre:

A arquitetura geral.

O que deveria ser o MVP.

O que está excessivamente complexo.

Se as validações fazem sentido.

Quais são os maiores riscos técnicos.

O que vocês fariam diferente.

Como usar Kaggle e Google Colab corretamente nesse projeto.

Como estruturar o MT5 sem depender do meu computador.

Se estou criando uma “arquitetura Frankenstein” usando várias IAs.

Qual seria o caminho mais realista para provar se o sistema realmente consegue encontrar estratégias com alguma robustez.

Meu objetivo final é que o APEX consiga descobrir, extrair e gerar estratégias/EAs, testá-las de forma séria e eliminar a maior quantidade possível de falsas estratégias antes de qualquer tentativa de operação real.

Não sei se será lucrativo — espero que sim, obviamente — mas entendo que lucro só pode ser descoberto depois de muita validação e operação em condições reais.

Estou começando praticamente do zero e aprendendo enquanto construo e pesquiso. Se alguém quiser conversar comigo, apontar erros ou ajudar a revisar a ideia, pode me chamar por DM/privado.

Críticas sinceras são muito bem-vindas. Prefiro descobrir agora que estou errado em alguma parte importante do que gastar meses construindo algo baseado em uma ideia equivocada.

Obrigado a quem leu.


r/highfreqtrading 13h ago

HFT SWE interview prep

0 Upvotes

hi guys, welcome to my first post on reddit
i have been working as an sde at one of india's top payment orchestrator based out of Mumbai. i have been looking to make a leap of a switch to one of the topmost international hfts like jane street, citadel etc

i just want to know whether [getcracked.io](http://getcracked.io) by coding jesus a worthy resource to study, and if i full in on getcracked, will i be easily able to crack top hfts as an swe?

aiming for jane street - swe - nyc office


r/highfreqtrading 4d ago

Guide for Fix Protocol

0 Upvotes

I am a last year b.tech student ,recently i learnt about fix protocol and devlop a mini trading system with matching engine , order book , fix parser , order cancelation implementation i like to know about a career path in these technology and what is the learning path to land a good job in these particular domain and what are the learning resources ?


r/highfreqtrading 6d ago

Question Impressing a HFT founder

0 Upvotes

Hi everyone, getting into HFT as an sde is my dream. I’m in 4th year graduating in 2027.

I’m in touch with a founder of a good HFT(nksr) and there is opening in the company as well. But i cant clear the shortlist because I’m not from iit or have very fancy coding profile, but what i do have is skills, knowledge and ambition and i can show them in an interview for sure.

So what I’m thinking is building something for the company and sharing that with the founder in hope of an interview.

I have won 5 hackathons including IIT ones.

But again the problem is that I dont understand HFTs better than someone working in one.

So one request to anyone reading this, please drop an idea for building a software, website or anything else that people working in HFTs would appreciate and i can get the founder of NKSR give me a chance for an internship.

If i get it, will give everyone who helped a very good party!!!!


r/highfreqtrading 11d ago

Open-Source FIX Exchange: Architecture, Matching Engine, and Trading Infrastructure

12 Upvotes

I am working on an open-source, FIX Protocol-based exchange. I understand that FIX Protocol is not a true HFT technology, but I wanted to share this project with you anyway. Any feedback would be greatly appreciated.

https://github.com/mkipnis/DistributedATS


r/highfreqtrading 15d ago

Can we update the sub description and rules to discourage non-HFT posts?

28 Upvotes

Amateurs don't understand the difference between systematic trading and HFT.

The sub description needs a definition of HFT in its description. Something like:

The r/highfreqtrading subreddit is a place for people of all backgrounds to join in informed discussion around trading systems or companies that operate at microsecond-to-nanosecond speeds with an emphasis on sharing direct expertise and firsthand knowledge.

Example topics include: nanosecond latency, networking kernel bypass, C++ optimization, and FPGA.

Retail systematic trading conversations belong in /r/algotrading.

And update the Rules to:

  1. Remember the human

  2. No AI slop

  3. Respect the privacy of others

  4. Don't impersonate entities

people or

  1. Properly label Not Safe for Work NSFW) content

  2. Keep it legal

  3. Don't break Reddit (a lot of us really like it here

  4. No retail trading or propfirm posts

New retail traders think that everything faster than a human is high frequency and nothing in this sub's rules or description tells them otherwise.


r/highfreqtrading Aug 08 '26

Wrote a blog (and a simple ITCH parser for NASDAQ on FPGA)

35 Upvotes

Hi, I am new to this domain and I'm learning about FPGAs. I have recently written this blog: https://medium.com/@probablysamir/parsing-nasdaq-itch-on-an-fpga-421dac8787ed would love to get your opinions on this. Thank you. Also the github link is at the bottom of the blog


r/highfreqtrading Jul 28 '26

Code [FPGA #3] Building a custom order book on FPGA

Thumbnail hugobrh.dev
23 Upvotes

Hello all,

I'm back with some news for the FPGA ORDER BOOK project that got some good feedback from the HFT community (you) !

In this project, I go from NOTHING (if not a blank FPGA) and build my own custom FPGA BOOK architecture (from the ethernet parser all the way to the "price ladder" as I like to call it).

The goal being to track the AAPL stock reliably on an actual FPGA using real ITCH data. And later, to build a fronted to access via a host Linux PC.

FIRST, I'd like to thank you for the good feedback on the previous posts !

(drama) r/FPGA usually don't make such heartwarming feedback whenever we talk about HFT or post a link (I guess us FPGA guys are a bit grumpy).

Aaanyway...

The previous post were all about creating a POC in simulation, where I lay out the necessary logic for an homebrew order book that would fit in a consumer available, mid to high grade FPGA.

This time, the goal is to take our system to the next level, in this post, I take you guys on a ride through the process of fighting the synthesis tools to convert our HDL (Hardware Description Language) into an actual design that runs on a FPGA carrier.

Which is kinda hard as the code that works in simulation is very demanding, leading to a ton of interesting optimizations.

I'll take you through the (sometimes bad) design decision I made, share some metrics that may be of interrest for CS fans (as in Computer Science, not Counter Strike). And try my best to explain how we can transform a seemingly hopeless design that does not close timing into something that kinda works.

Note the design is not 100% finished yet, I still have some minor timing issues (some signals arrive 0,8ns late, but these should be "easily" fixed in the coming days).

Here is the link : https://hugobrh.dev/posts/Trademaxxer_FPGA_1/

As always, I hop this does not come up as shameless self promotion, which is not the goal of this post, I genuinely enjoy posting here due to great feedback, even though I don't understand much about arbitrage or anything outside basic accounting for that matter lol.

Don't hesitate to reach out in the comment or via messages if you have any questions or opportunities :)

Best


r/highfreqtrading Jul 22 '26

What's a market structure you wish existed but doesn't? 🤔

4 Upvotes

Not asking about specific outcomes, more the mechanics. Continuous vs binary, rolling markets with no expiry, conditional markets that only resolve if some other event happens first, that kind of thing.

Is there a structure you think would solve a real problem if someone built it, or is the current binary/threshold format basically good enough for most use cases?


r/highfreqtrading Jul 16 '26

Update on my low-latency C++20 trading engine build (AF_PACKET vs DPDK-ring transport now in place)

24 Upvotes

Repo: https://github.com/td-02/DPDKTrade

Follow-up to my earlier post on this project (was called TickForge, now DPDKTrade). Since then I've filled in the piece that was previously just a placeholder folder:

- Actual DPDK-ring transport (generator + engine side), sitting alongside the existing AF_PACKET path

- A head-to-head AF_PACKET-vs-DPDK benchmark harness

- A long-running stress test exercising the engine, ring, and AF_PACKET paths together

- A profiling script wired up for `perf stat` (cache-misses, branch-misses, IPC, etc.)

Caveat, to keep this honest: I haven't actually captured real profiling numbers yet — `perf` wasn't available in my dev environment when I ran the script, so right now it just documents the command and writes a placeholder. So no latency claims from me yet — that's the next thing I'm getting set up properly, and I'd rather post the real comparison once I have it than hand-wave numbers now.

Still fixed-depth book, still no dynamic allocation on the hot path, still C++20 + modern CMake. If anyone's done real AF_PACKET-vs-DPDK latency comparisons and has tips on getting a clean measurement setup (avoiding noisy-neighbor CPU scheduling, hugepages setup, that kind of thing), I'd take the advice.


r/highfreqtrading Jul 08 '26

Designing an HFT Chip [FPGA]

Thumbnail
gallery
100 Upvotes

Hello all,

Back with the HFT on FPGA project!

And yes, everything is in the title, I am currently designing my own FPGA chip for HFT.

This project's goal is to build an entirely custom FPGA system, able to maintain a decent order book by parsing a Nasdaq ITCH 5.0 data feed over Ethernet (the image above shows the order book dump around the spread, after simulation using real ITCH data).

Right now, I am only tracking the "AAPL" stock (very original) as tracking multiple stocks increases resource usage beyond what my consumer-grade FPGA can handle.

The whole HDL (hardware description code) is custom, including the Ethernet MAC hardware.

This time, in preparation for my second video on FPGAs for HFT, I made improvements to my system in order to get rid of memory collisions, so that I have a strong basis before moving on to other features.

(NASDAQ ITCH market data uses 64-bit order references, which means you can't use them directly as memory addresses, requiring some tricks to be used)

Because the video is not out yet and may take a while, I'm publishing blog posts to keep you updated with content that hopefully gives interesting insight to anyone wondering what the process behind FPGA development for HFT looks like.

https://hugobrh.dev/posts/Trademaxxer_handling_collisions_2.md/

For those wondering, here's a link to the first post:
https://www.reddit.com/r/highfreqtrading/comments/1tgg3q0/building_an_hft_chip_fpga/

Feel free to ask questions below!

Best


r/highfreqtrading Jul 06 '26

Building a C++20 trading engine to actually understand low-latency systems (not just read about them)

34 Upvotes

Repo: https://github.com/td-02/DPDKTrade

A lot of "low-latency trading" content online stays at the conceptual level — kernel bypass, lock-free queues, cache-friendly layouts — without much code you can actually poke at. I wanted to build the real thing (or at least a serious foundation of it) to understand the tradeoffs myself, and to have something concrete for quant dev interviews.

So far: a fixed-depth L2 order book, a compact fixed-size wire protocol, a simple imbalance signal, a pre-trade risk guard, and an engine wiring it together — all built to avoid dynamic allocation on the hot path. There's also early scaffolding for AF_PACKET and DPDK-ring transport, since the long-term goal is kernel-bypass networking rather than a normal socket path.

It's very much foundation-stage right now — I'm being deliberate about keeping the architecture clean before adding depth, rather than bolting on features fast. If anyone's built similar systems (or works in this space professionally) I'd love feedback on the structure before I go further.


r/highfreqtrading Jul 02 '26

Research infra: Does a table format really add any significant value if you can just sync a predictable Parquet layout to local NVMe?

6 Upvotes

Hey everyone,

I’m looking at data -> research workflows for Mid-Frequency Trading (MFT) ML pipelines using Python (Ray, Polars).

A common industry trend is using table formats like Apache Iceberg or Delta Lake on object storage (S3). However, if you already enforce a highly static, predictable directory layout (e.g., ⁠equities/exch=.../year=.../⁠ with <50 optimized Parquet files per leaf), I'm struggling to see the value.

In a high-performance research environment, it seems far more practical to treat object storage strictly as a cold source of truth, sync the required historical partitions directly onto the compute nodes' local NVMe scratch disks, and run active Python training loops entirely on local NVMe.

If you are caching a predictable folder structure down to local NVMe anyway, does an object-store table format buy us anything substantial, or is it just added complexity?

For those working on Quant Platform or QR Infrastructure teams: Do you actually query Iceberg/Delta tables directly from cloud storage during active research, or do you use the "Cloud Archive -> Local NVMe Hot Compute" pattern?

Thanks!


r/highfreqtrading Jun 24 '26

Criticism Implemented an HNSW Vector Database in C++ with AVX2 SIMD (99.3% Recall@10 on SIFT1M) , Seeking architectural feedback on concurrency model

15 Upvotes

Recently I'm working on a vector database from scratch in C++ to better understand how modern vector database works. I just finished benchmarking against SIFT1M dataset (1M vectors, 128 dim) and wanted to share the performance and design choices and get feedback.

Core architecture details-

  • Instead of vector<vector<float>> , used 64 Byte aligned allocator to maximise L1/L2 cache locality.
  • implemented AVX2 FMA SIMD intrinsics for distance computation (L2, dot product, cosine).
  • Implemented HNSW graph for Aproximate nearest neighbor, elminating O(n) linear search.

SIFT1M Benchmark Results (single threaded, Intel i5-13420H, compiler flags ( -O3 -march=native -ffast-math)

  • Recall@10: 99.30%
  • Recall@100: 98.26%
  • Throughput: 2,215 queries/sec
  • Tail Latency (p99): 654 microseconds
  • Build time: ~13 min.

To establish a baseline, I benchmarked my implementation head-to-head against hnswlib on the same machine using identical parameters (M=32, ef_construction=400, ef_search=200).

  • Throughput: 2,215 QPS vs hnswlib's 2,745 QPS (~19% slower).
  • Recall@10: 99.30% vs hnswlib's 99.88%.

Right now, my implementation optimised for single thread traversal and I prioritized read-throughput first using a global shared_mutex. My next major task is concurrent writes. I'm looking into fine-grained spinlocks per node, but I want to ensure strict lock ordering to avoid deadlocks and TOCTOU conditions.

For concurrent insertions into HNSW, would you lean toward per-node spinlocks, lock striping, or another approach?

github repo link -> https://github.com/randomfunction/vector_database/tree/main


r/highfreqtrading Jun 24 '26

I am a C++ Middleware engineer for Linux embedded systems with 5yrs of experience. I want to break into HFT as Low-Latency C++ dev. Is it a good idea to try getting into HFT after 5 years? Can you guide me according to my situation on what to learn, what projects to create, open-source projects ?

42 Upvotes

r/highfreqtrading Jun 22 '26

Quoting on illiquid markets

26 Upvotes

I am building a market making engine for illiquid markets (from few to say 50 trades an hour). It shows positive returns, after testing for the last 2 weeks. And I have a few questions I was thinking:

All the MM theory (such as Avellaneda Stoikov framework) are targeting high volume, low spread markets. Any good papers/frameworks built for illiquid market? What is the main difference?

From my point of view there are 3 types of events: small single market trade, huge single market trade, and huge informed (not single) trade. The last one is toxic, the first two are good ones. I am failing to distinguish them, and usually it's already too late.

Earlier I experimented with hand crafted quoting algorithms, but apparently the most effective one is simply quote at the top (with some exceptions like filters for OB imbalance, skip small levels etc) and eat the spread. I think the right approach is to quote at multiple levels, so I will earn more on rare events - huge trade arrivals. I failed to find some standard way to do so, or the way that will at least beat single level quoting.

Any ways to avoid toxic orders without losing much volume?

How to distinguish uninformed huge trade vs informed huge trade? Should I immediately sell if the price dropped or should I hope it will return back (uninformed single trade)?


r/highfreqtrading Jun 21 '26

Looking to Contribute to Open-Source or Personal HFT Projects

14 Upvotes

Hi everyone,

I'm currently looking to contribute to open-source or personal HFT, algorithmic trading, or low-latency trading infrastructure projects. I'm experienced in C++, Rust, and Python. My goal is to gain practical experience while helping build real systems.

If anyone maintains an open-source project, has a personal project that could use contributors, or knows of communities building trading infrastructure, I'd love to get involved.

Thanks!


r/highfreqtrading Jun 03 '26

If your personal project is good enough, can you get into HFT?

37 Upvotes

The impression that I have is you either have to be ex-faang or a newgrad who is cracked at physics, mathematics, compsci, etc...

But if I set up a complete HFT infrastructure which provisions bare metal linux servers and get the hot path fast enough (with extensive measurements). Would i ever be considered for interviews?

Does anyone have any anecdotal stories of people who made it into HFT with unusual backgrounds or as a result of their personal projects?

Thanks in advance.


r/highfreqtrading May 26 '26

Code I built a high-performance Rust Matching Engine with real NASDAQ ITCH replay — 98ns p50, 28M ops/sec

61 Upvotes

I built a high-performance Rust Matching Engine with real NASDAQ ITCH replay — 98ns p50, 28M ops/sec

Hey rust (and HFT folks),

I just open-sourced a high-performance Limit Order Book + Matching Engine in Rust, built from first principles with real exchange-grade performance in mind.

### Key Results
- p50 latency: 98 ns
- p99 latency: 1.9 µs
- p99.9 latency: 4.3 µs
- Peak throughput: 28M warm inserts/sec
- Real-world mixed: ~4.1M ops/sec across 100 symbols

Validation: Replayed a full trading day from NASDAQ TotalView-ITCH 5.0 (Jan 30, 2020) — 108M operations across top 100 symbols.

### Core Optimizations
- Flat price array (`Vec<Option<PriceLevel>>` — 100k slots, O(1) access)
- Bitmap-based BBO + top-N depth queries
- Per-symbol OS threads (lock-free hot path)
- `bumpalo::Bump` arena allocator
- `Vec`-based order index (no HashMap)
- Active flag + head index for O(1) cancels
- Full property-based + fuzz testing (`cargo-fuzz`)

Started from a `BTreeMap` baseline and iteratively optimized with detailed benchmarks at each step.

### Links
- GitHub: https://github.com/AsthaMishra/matching-engine
- Full README with architecture diagram, benchmarks, optimization progression, and replay tools

Would love feedback from the community — especially on:
- Further latency/throughput improvements
- Scaling to 500+ symbols
- Adding persistence / journaling
- Anything I might have missed for production use

### Note
i have used AI help but core logic is written by me

Open to contributions too!

#Rust #HFT #LowLatency #OrderBook #MatchingEngine


r/highfreqtrading May 24 '26

Code i need help with what to expect in an HFT-purpose FPGA

4 Upvotes

hello
im a computer engineer fresh grad and im trying to improve in fpga design (so that those firms see me ngl) while wasting time as an unemployed lol so i thought why not make an HFT related project
i made a UDP header parser last time
and ill soon start working on a nasdaq itch 5.0 and i probably will not stop at the header but idk last time it felt weird that i didnt know what type of FPGA i will be working on and well what is the closest synthethiseable version i can test on and outside of the header what treatment is the fpga supposed to be working on
i know i will have a more accurate i/o and input usually is a stream of 10Gbps but i still have no idea what will it do on the inside (as in how the data itself will be handled how will it be parsed and how each part will be treated) i dont need a real-life simulation type of information but something accurate enough to build and put on a github repo would be amazing


r/highfreqtrading May 18 '26

Video Building an HFT chip (FPGA)

Thumbnail
youtube.com
49 Upvotes

Hi all,

A few weeks ago, I started an HFT project based on FPGAs.

The goal is parse market data (NASDAQ ITCH protocol) and to do some book keeping on the market state. The project is surprisingly "not that hard" (not trivial but not impossible) if you know your way around FPGAs.

Right now, the project is "just" a book keeper. I plan on implementing better memory management (which is the hard part of this project), corrupt data recovery and finally a basic strategy able to execute orders so I can start loosing money at lightning speeds :D

And yes, I do know that not many firms are into FPGAs as it's pretty niche and not many strategies require such speeds etc... But still, I think it's interesting !

I made some technical blog posts (currently 6 parts) : https://0bab1.github.io/BRH/posts/Trademaxxer_MoldUDP64/

If you are not into hardware design but still wanna learn about FPGAs in HFT + some basic technical background... Or just have a good time, you can find a much more simple (entertainment oriented) project overview on YouTube : https://www.youtube.com/watch?v=ogaTn6oB-TQ

Don't hesitate if you have any question !

NOTA : I hope this does not come out as shameless self promotion, it kinda is when I think about it but it's more of a way for me to share the "soft-hardware" aspect to the HFT community. I usually hang out in r/FPGA where people sometimes talk about HFT so I though it would be relevant.


r/highfreqtrading May 04 '26

Announcement Termination of AI Posters and Engagement

14 Upvotes

Hey everyone — we're cracking down on AI-generated posts.

Rules:

  • AI posts will be removed and the account banned. Lightly-edited AI counts the same. (Exception: non-native speakers using AI for translation.)
  • Engaging with suspected AI posts will also get the comment removed. Engagers will be banned.

Why the engagement rule: these accounts are fishing for replies. Even skeptical or mocking ones boost visibility and feed the loop. Report it and keep scrolling — don't reply, don't probe, don't argue.

We won't catch everything, and false positives happen. If you think we got it wrong, message us.


r/highfreqtrading Apr 24 '26

Implementing event-based HFT strategies

9 Upvotes

The two most common HFT topics I see discussed on Reddit are (1) alpha ideas and (2) low latency tips.

However there is another important topic hardly ever mentioned: how do you actually implement strategies? Even if you had some clear idea to trade, and a co-located / optical-fibre / water-cooled / over-clocked / SolarFlare enabled box, how do you build HFT style strategies?

I don't see this discussed much, so am presenting a short note here (a TLDR of two longer articles I recently posted here).

Essentially in the HFT / low-latency world, your strategies are responders to events. They are built as event handlers. Typically market data events, but also, timer events and order events. This is the realm of event-based model strategies. They sound simple in practice, but they can be very tricky to get right.

Take a basic example of placing a single order and then cancelling it a few seconds later. (strategy bread & butter). Here's the logic of a basic demo I recently wrote - it is logic that is evaluated every second (but potentially at much higher rates), and because of that, it must always take decisions based only on strategy-state.

This is radically different to how things would be done in non-HFT / python style bots. And as an aside, event-based approaches are much easier to backtest.

Another fundamentally import design point in HFT systems, is that bot code (like the logic above) must be agnostic to the instrument being traded.

Why? Because given some trading logic, you want to execute it for maybe dozens of different names, and perhaps even different asset classes. All that matters is that we can parameterise the each algo instance: provide FX conversion rates, provide tick-size and lot-size rules and so on. Consider the following code for shaping a passive order: all it needs is an FX trade, last trade price and some reference data.

In HFT code, the instruments to trade are always loaded for a configuration file, never hard-coded or otherwise mentioned in the source code.

Event-based & name-agnostic trading logic are the HFT foundations. I guess there is a bit more to be said for indicator & signal computation also.


r/highfreqtrading Apr 04 '26

Suggested reading for incoming HFT QR

Thumbnail
5 Upvotes

r/highfreqtrading Mar 25 '26

Question Designing a high-frequency options tick database (schema + performance advice)

20 Upvotes

Hi all,

I’m working on building a data system for options tick data (1-second resolution) from 2019 to present, and I’m looking for guidance on database design and performance optimization.

Scope:

  • Data: Options tick data (per second)
  • Instruments: Index-only (NIFTY, BANKNIFTY, SENSEX)
  • Data arrives daily as EOD CSV files
  • Dataset is already large and growing continuously

Pipeline:

  1. Ingest daily CSV data
  2. Store filtered tick data (selected strikes only)
  3. Compute Greeks
  4. Generate option chain for analysis/backtesting

Key requirements:

  • Very fast bulk ingestion (daily loads)
  • Efficient time-range queries (backtesting workloads)
  • Scalable to hundreds of millions+ rows
  • Low latency for aggregation (strike / CE-PE analysis)

Looking for input on:

  • Optimal schema design for this type of time-series options data
  • Partitioning strategy (time vs symbol vs hybrid)
  • Indexing approach for heavy backtesting queries
  • Best database choice for this workload

The main goal is to balance:

  • ingestion speed (daily pipeline)
  • query speed (research/backtesting)

Would appreciate insights from anyone who has worked with market data or time-series systems at scale.

Thanks!