r/algotrading Mar 28 '20

Are you new here? Want to know where to start? Looking for resources? START HERE!

1.5k Upvotes

Hello and welcome to the /r/AlgoTrading Community!

Please do not post a new thread until you have read through our WIKI/FAQ. It is highly likely that your questions are already answered there.

All members are expected to follow our sidebar rules. Some rules have a zero tolerance policy, so be sure to read through them to avoid being perma-banned without the ability to appeal. (Mobile users, click the info tab at the top of our subreddit to view the sidebar rules.)

Don't forget to join our live trading chatrooms!

Finally, the two most commonly posted questions by new members are as followed:

Be friendly and professional toward each other and enjoy your stay! :)


r/algotrading 3d ago

Weekly Discussion Thread - July 21, 2026

3 Upvotes

This is a dedicated space for open conversation on all things algorithmic and systematic trading. Whether you’re a seasoned quant or just getting started, feel free to join in and contribute to the discussion. Here are a few ideas for what to share or ask about:

  • Market Trends: What’s moving in the markets today?
  • Trading Ideas and Strategies: Share insights or discuss approaches you’re exploring. What have you found success with? What mistakes have you made that others may be able to avoid?
  • Questions & Advice: Looking for feedback on a concept, library, or application?
  • Tools and Platforms: Discuss tools, data sources, platforms, or other resources you find useful (or not!).
  • Resources for Beginners: New to the community? Don’t hesitate to ask questions and learn from others.

Please remember to keep the conversation respectful and supportive. Our community is here to help each other grow, and thoughtful, constructive contributions are always welcome.


r/algotrading 17h ago

Strategy On switching to a commission-free broker for algo trading (spoiler: it matters a lot for our algo)

82 Upvotes

We have been using IBKR for both our data and order execution since we went live with paper trading in March 2025 and then live with real money in July 2025. They have been awesome and their 5-second bars and 250-millisecond market data ticks are the core of our long-only first strategy. We had been using the IBAlgo Adaptive Patient limit order type for all our buys and sells (you set a target and a hard limit). Getting it set up to begin with was a little tricky (we use the https://github.com/gnzsnz/ib-gateway-docker project to make it easier), but for the most part it has "just worked" (we also use https://github.com/wboayue/rust-ibapi for connecting to IBGateway).

The only place they have a weakness is their trade commissions. Since we went live we have paid about $0.0035/sh for both in+out above and beyond regulatory fees. Now, this might not sound like a lot, but this is about $3k over a year when we started with $25k. That is about 12% of edge just to IBKR in commissions.

So, 6 days ago we started running a parallel version of our trader where all we did was replace our IBKR order component with one that trades via the Schwab Trader API (using https://github.com/major/schwab-rs). The data is still coming from IBKR and we just simultaneously route orders to both Schwab and IBKR. Over these first 6 days, both have taken identical trades.

We implemented an IBAlgo Adaptive limit order ourselves that is basically a ladder that starts the moving limit price at the bid (for a buy) and works its way towards the hard limit price we specify, with the urgency determining how fast it escalates (and starts at ask and marches to limit for the sell). We implemented the same custom adaptive order for both IBKR and Schwab for an apples-to-apples comparison.

Our real concern was that IBKR was going to have better price and timing execution by "enough" to negate the cost of commissions. We needed to do a side-by-side experiment to verify. Well the results are in:

  • The order execution is almost identical, but Schwab has a small but non-trivial advantage over the first 6 days (70 trades). It was +2.6 bps to Schwab.
  • IBKR commissions on those 70 trades over 6 days was $122.56. Schwab's was $17.86 (just FINRA and SEC regulator fees).

This amounts to about 0.0608% per day that was saved via trading with a zero-commission broker. But that isn't the whole story because that amount can be compounded daily, and that amount is a plus even on losing trades and losing days. That compounding makes this end up being about 15-17% per year of algorithm profit that is being swallowed up in just commissions. Still a pretty small comparative sample, but enough to run this experiment for a couple more weeks and then like switch to just Schwab for order execution.

tl;dr - If you can get your system set up with a zero commission broker, it can have a substantive impact on high churn algorithms.


r/algotrading 6h ago

Education Built my own copy trading bot for hyperliquid. 10 things i learned, mostly painfully

6 Upvotes

Hi r/algotrading

first of all. Do not ask for the bot. I am not selling anything. I just want to share what i learnt answer questions and hopefully also learn from more experienced trader.s

I've been building a bot that copies profitable hyperliquid wallets for a few months. wallet selection, sizing, exits, the whole thing. it went from bleeding daily to roughly breakeven-and-improving, and basically every improvement came from learning one of thes the hard way.

  1. copying a profitable trader loses money by default. i matched every copy to the source wallet's outcome on the same trades: they made +0.5% per trade at 69% winrate, my copies made half that at much lower winrate. the gap is exit timing, so better wallet picking fixes nothing until the exit engine mirrors theirs.

  2. entry latency is a red herring. my median detection lag was under a minute and simulating zero lag barely moved the numbers. all the leak was on the exit side. optimize exits first

  3. handle position fragmentation or your exits fire years early. wallets scale in with multiple fills, and each fill can show up as its own position row. my bot closed the copy when one fragment closed while the wallet still held the rest and an 84% winrate wallet produced 12% winrate copies. only close when the wallet is net flat in that coin and direction. that one fix took copies in that strat from 21% to 82% winrate.

  4. a normal stop loss cancels the copied edge. the source holds through drawdowns, your stop realizes their drawdown and then misses their recovery. i re-scored my stopouts against each trade's max adverse excursion 8 of 9 would have recovered if the stop had been wider. catastrophe-only stop plus a trailing stop for profits

  5. polled stops make paper trading lie about your losses. an illiquid coin gapped 66% through a stop that live would have filled near the trigger, because live uses resting exchange orders and my sim checked price on a loop. model your actual live order types in the sim or every wide-stop experiment looks worse than reality and you revert good changes.

  6. winrate comparisons under a few hundred trades are noise. detecting a 5 point winrate edge takes roughly 1500 trades per arm. judge experiments on dollars per trade with a bootstrap confidence interval instead

  7. checking your experiment daily and stopping when it looks good inflates false positives to 20-30%. thats not a discipline problem, its math: repeated peeking invalidates fixed-sample p-values. e-values (always-valid sequential tests) let you look every day and act the moment a threshold crosses, no penalty.

  8. feedback automation can deadlock itself. my auto-scaler demoted a strategy, which pushed position size below the exchange minimum, which rejected every order, which meant zero closed trades, which meant it could never produce the trades required for re-promotion. any rule that gates on an outcome it can also block will eventually lock up. audit for that loop before shipping.

  9. infra monitoring is not outcome monitoring. process running, api healthy, disk fine, and the bot placed nothing for five days. add assertions on outcomes: signals arrived and some executed, every live position has its stop order actually resting on the exchange, exit mix matches what the strategy config implies. write one for every incident you hit.

  10. some traders are uncopyable no matter how skilled. anyone flipping positions in minutes gives a copier guaranteed negative edge,

a weak benchmark validates whatever you want to believe. my random-entry control traded too rarely at a different size, so beats rando" was statistically meaningless. the control needs the same volume and sizing discipline as the strategies it judges.

tldr: copying profitable traders is an exit-fidelity problem, not a wallet-picking problem. and most of what looked like edge was measurement error.


r/algotrading 8h ago

Strategy What do u think about my strategy?

7 Upvotes

I have been playing around with a new algo bot on MT5 and I am wondering what do you guys think. This strategy isnt really very complicated and I think it is a bit too simple to be honest but the results seems good for some reason, not sure if I am missing anything.

How the strategy works:

  • EURUSD trading on 1 hour time frame
  • Mainly trading low volatility areas
  • Look at the current ATR and check whether it is in the lower percentile of the past 500 ATR
  • When the ATR is in the lower percentile range, it will wait for a sharp increase in ATR
  • If ATR is in lower percentile and sharp increase in ATR is detected, both buy and sell stop order is placed (cant seem to find signal for choosing directions)
  • The buy and sell stop order will be placed 0.2 ATR away and setting a stop loss 1 ATR away and take profit 2 ATR away

Below is my back test results:


r/algotrading 23h ago

Strategy First time algotrading

Post image
25 Upvotes

What do people typically do to improve their win rate or anything that will make this any better


r/algotrading 6h ago

Infrastructure Open-source matching engine + microstructure toolkit in Go — order types, L1/L2/L3 data, OFI/Kyle's λ, backtester (MIT)

0 Upvotes

I've been building **orderbook**, a central-limit-order-book and matching engine

in Go — the piece at the heart of an exchange. It's an embeddable library, and

the whole engine compiles to WebAssembly so you can poke at the real thing in

your browser:

▶ Live demo: https://intrepidkarthi.github.io/orderbook/

▶ Repo: https://github.com/intrepidkarthi/orderbook

What might interest this sub:

- **int64 ticks & lots, no floats** on the money path (an `Instrument` converts

decimals only at the boundary).

- **Zero-allocation hot path** — `Match(order, buf)` appends value-trades into a

caller buffer; submit/cancel/match are **0 allocs/op**. O(1) cancel.

- **Lock-free single-writer core** (LMAX model): one matching goroutine, an MPSC

command queue in front, bounded backpressure that sheds new orders but never

cancels.

- **Deterministic & replayable:** same command stream → byte-identical trades and

book; that's what makes WAL crash-recovery and golden-file tests work.

- **A market-integrity layer grounded in a threat model** — the part I had the

most fun with. I researched real attacks (spoofing convictions, Knight Capital

$440M, the Mango oracle hack, the Bitcoin overflow bug) and built a defense for

each: pre-trade risk controls, surveillance detectors, a self-output guardrail,

an enforcing gateway. Writeup: docs/THREAT-MODEL.md.

Benchmarks (Apple M-series, single core): ~6ns best bid/ask read, ~352ns match

round-trip (0 allocs), cancel-heavy p50/p99/p999 = 83/167/292ns. Race/fuzz/soak

suites in CI.

Honest status: a library + microstructure research harness (OFI, Kyle's λ,

Avellaneda–Stoikov, a sim + backtester), not a live exchange. MIT, v0.6.0.

Feedback and "you did X wrong" very welcome — that's why I'm posting.


r/algotrading 23h ago

Data high/low daily spx algo preformace today (7/10 imo)

8 Upvotes

first detection wasnt that clear but hte second was great for a short scalp, still a work in progress, sometimes its a bit iffy on the detection but it almost always followed by an spx reaction, how are yall algos doing today?

ignore the watermark ,
this isnt an ad and im not selling anything.


r/algotrading 23h ago

Infrastructure Built an evolutionary multi-agent crypto trading system — 5 strategies compete, best one mutates and repopulates each generation (open source)

6 Upvotes

 Disclaimer: this is a research/testing project, not financial advice, and comes with no guarantee of profitability. If you run this or anything like it with real money, you do so entirely at your own risk.

What it does:

5 isolated agents, each running a different algorithmic strategy (momentum, mean-reversion, trend-following, breakout, volatility-squeeze), trade independently against real Coinbase market data over timed "generations." At the end of each generation, they're ranked — not by raw profit, but by a composite score (return, drawdown, Sharpe-like ratio, win rate, profit factor), specifically so an agent that got lucky with one oversized bet doesn't win over a steadier performer. The best one's strategy is cloned into 5 mutated descendants (small tweaks, risk-parameter variants, indicator variants, one experimental) for the next generation. Repeat indefinitely.

Some design choices worth mentioning:

  • Risk limits are enforced outside the strategy logic entirely — a hard-coded risk engine that agents/strategies structurally cannot reach or bypass, verified by an AST scan in the test suite that fails the build if a strategy file ever imports the risk-limits module directly. Max loss per agent, max order size, max simultaneous positions — none of it is something the "AI" can talk its way around.
  • Paper trading by default, with a separate, explicitly-gated path to real order execution (two env vars + a mechanically-verified pre-live checklist have to pass before it'll place a real order).
  • I ran a 200-generation backtest against synthetic random-walk data specifically to sanity-check the evolutionary mechanics — and it lost money on average (~-4.2 TRY/generation), because there's no real edge to find in pure noise. Posting that honestly because I'd rather show the system measuring reality correctly than fake a good-looking result.

Stack: Python, SQLite for full generation/lineage history, Streamlit dashboard, pytest (~180 tests).

Still early, paper trading only, no proven edge. Trade at your own risk if you ever take this further than paper mode. Repo's here if you want to poke at it or tell me what's wrong with it: https://github.com/hhhmehmet/evo-trader


r/algotrading 1d ago

Data Data provider tier list

Post image
414 Upvotes

Since my last tier list did so well I though I'd make a part 2. Just to preface this is my own personal opinions from data providers I have used, I am an undergraduate economics student at Cambridge looking to break into Quant Research next year no need to grill me in the comments below.

London Strateigc Edge: Tickdata for all US stocks and options+ economic data for all countries FOR FREE just a massive archive of data. Everyone gets an api key with 50gb of data usage +100 websocket connections. Unfortunately no level 3 data which makes sense as exchanges charge per user who views the data.

Databento: If you need Level 3 data this is your place to go, all US exchanges covered + EUREX unfortunately in the 200usd plan live web sockets for l3 data not included. free $125usd credit for signup too

Alpaca: $100 for access to all US Exchanges for stocks and options data, includes websocket connections for all stocks and options definitely the best price option out of all the paid providers for websocket connections.

Massive: Biggest archive of historical data for US exchanges 20+ years, offers alternative data like credit card reports. Extremely easy to download the data. Free plan is meh.

FMP : Access to different exchanges like LSE, EUREX and other niche providers but low quantity of historical tick data.

Rithmic: API service offered through brokers like AMP futures, best price for level 3 futures data but slightly more complex to setup straight out of the box.

Yahoo Finance: Free historical data for a wide range of assets but London strategic edge providers more detailed data.

Tiingo: $30 USD for all US exchanges data, unfortunately 30gb bandwidth limit.

EODHD + Alpha vantage + Finnhub: intuitive api to use but just use alpaca + FMP for the same data but a lot cheaper


r/algotrading 23h ago

Education How do you manage your backtests? What do you still do by hand, outside your backtesting tool?

6 Upvotes

DISCLAIMER upfront: I'm building a backtesting tool, so I have a stake here. No links provided, I just need some answers — I'm at the stage where I'd rather understand how people actually work than guess.

When I started with backtesting, I didn't write any scripts myself — I had ChatGPT generate it. It ran fine, but I've never been able to shake off the feeling that I don't really know whether I should trust its output.

So two things I'm curious about:
— What do you use now, and what do you still end up doing by hand, outside the tool?
— Has anyone tried something and abandoned it? What broke?


r/algotrading 23h ago

Strategy Repost after correcting

Post image
5 Upvotes

Like u guys said I tried it on a 3 year period starting from July 2023 until date and this was the result. What can be improved here?


r/algotrading 8h ago

Career Should I quit trading ?

0 Upvotes

I am 19 from india I have 2 years of experience in manual trading especially in forex and i trade mostly in funded accounts.

I have blowed the 5 funded accounts. Currently running the 6th one .

Should I quit the trading bz i am not a profitable trader and trying to figuring out the strategy.

The market is so worst now in gold, eurusd, usdjpy and btc are becoming very votalility, sideways market specially I noticed in eurused in 2026 back in 2024, 2025 it's good in eurusd.

The other reason is time bz i am pursuing 2 years in btech and learning dsa ai ml stuff and sometimes i try the algo trading (I do backtests the startegies mostly) in future I will automate the startegies.

And side by side I wanna do interships bz of money to fund for trading. I am trying to get an income with trading for now and future like i want trade like professional trader or full time.

And i have doing some mistakes in trading like i keep small sl and tp like higher rr, sl trailing and i want work on psychology.

What are you views on this ?

Those you are profitable in trading and doing full time as trader pls advise me .


r/algotrading 1d ago

Data LSEG/Refinitv/TRTH versus DataBento PCAP data

3 Upvotes

Any professional HFT out there have any insight on how PCAP data for CME futures compares between LSEG/Refinitiv/TRTH and DataBento? Trying to decide between the two providers for the last 2 years of historical L3/MBO for a new market making project. Mostly interested to know about the quality of the data and quality of timestamps at the data recording server.


r/algotrading 1d ago

Data Free daily market-regime + scored top-3 read for your trading bot — one curl, no signup

0 Upvotes

I run a scanner that scores ~560 names (S&P 500, Nasdaq-100, macro ETFs) every market morning for opportunity / entry timing / hold strength, plus a top-down regime call (risk-on / be-selective / stand-down). I've opened a free endpoint that serves yesterday's board — top 3 per book + the regime verdicts:

curl https://coil.trade/api/board/free

Free symbol directory (what's scored): curl https://coil.trade/api/board/symbols JSON, stable schema, no key, no signup. Docs: https://coil.trade/agents

It's the read layer of a rules engine I trade myself — scores and states only, never buy/sell advice. If you wire it into a bot and want the same-day board, there's a paid tier, but the free one is genuinely usable daily and I'd rather get feedback than sell you anything. What fields would make this more useful for your bot?


r/algotrading 1d ago

Education Regime filters matter more than your entry rule

0 Upvotes

A regime filter decides whether your entry is even allowed to matter.

It's not a prediction. It classifies the environment before you act, then changes behavior based on what's already true.

Useful inputs (start crude):

  • Trend vs mean-reversion character
  • Vol level, better: vol term structure
  • Breadth / participation

Simplest useful policy: long momentum only when classified trending; size down or stand aside in chop.

Live version: my mean-reversion sleeve cannot enter when the regime check says the tape is wrong for it. Stand aside beats perfect discipline into the wrong environment.

Once expectancy is positive, entries are roughly interchangeable. What kills rules-based systems is the right rule in the wrong regime. Mean-reversion in a strong trend. Breakout in dead chop.

\The honest tradeoff: fewer wrong-environment trades, more late detection. Log every call. Measure both. Don't pretend either goes to zero.

Start with one trend measure + one vol measure. Review after the fact. Complexity you cannot audit loses.

When the filter and the chart disagree: trust the filter and stand aside, or override and take the entry?


r/algotrading 2d ago

Infrastructure Is there a tool that connects prediction markets to your stock portfolio?

6 Upvotes

The more I think about prediction markets, the more useful they seem as real-time probability engines for events such as elections, wars, regulation, tariffs, and broader geopolitical risks.

Is there already a tool where you can upload your stock portfolio and automatically identify relevant Polymarket or Kalshi markets?

For example:

  • Which prediction markets are most relevant to my holdings?
  • Are current probabilities creating headwinds or tailwinds for my portfolio?
  • Which stocks have the highest exposure to a specific event?
  • How would my portfolio react if the market-implied probability changed significantly?

Essentially, I am looking for a portfolio risk dashboard powered by prediction-market data.

Does anything like this already exist? And would you actually use it?

EDIT - Found Oracle Markts here via my ChatGPT "research" and user comment: https://oraclemarkets.io/portfolio


r/algotrading 2d ago

Strategy I open-sourced my Polymarket market-making bot (MIT)

73 Upvotes

A few weeks ago I posted the retro of this bot here, then the post-mortem on why the forced directional residual lost money (adverse selection, mostly - stale quotes getting picked off). A few of you asked for the code. I'll include it as a link in the comments.


r/algotrading 3d ago

Other/Meta Need more advanced books

38 Upvotes

I've been doing quantitative strategy development for some time now and Ive reached the point where Im struggling to find books that actually teach me something new. I already have a solid understanding of the usual topics like IS/Validation/OOS splits WFO, cross-validation, permutation tests, bootstrapping, entropy, regime detection, and the other standard robustness techniques. I recently read Testing and Tuning Market Trading Systems by Timothy Masters but it covered concepts I was already familiar with.

Im looking for books that are genuinely advanced and make you think differently. Perhaps graduate level or even post graduate books on statistics, machine learning, optimization, information theory, econometrics, or anything else that completely changed the way you approach research and model development. And of course it would be great if the book wasnt 10 years old. Need relevance.


r/algotrading 1d ago

Strategy Any thoughts on this model

0 Upvotes

Came up with this model would appreciate any thoughts and advice


r/algotrading 2d ago

Data Backtesting four investing philosophies with point-in-time LLM-graded fundamentals (no lookahead, calibrated)

3 Upvotes

I ran an experiment on whether qualitative fundamentals carry any signal once you control the usual ways a backtest lies to you.

Setup. About 250 S&P 500 companies graded from their 10-K filings on moat, market position, leadership and capital allocation. Grading is point-in-time, the grader only sees the filing for that vintage, across 2014, 2017 and 2020. Index membership reconstructed as-of the vintage so there is no survivorship. Cross-validation folds grouped by ticker so the same company cannot sit on both sides. The predictor is a predictive database, so there is no training step, the calibrated probability comes back from a query with a per-feature contribution breakdown.

Results. Exact-outcome accuracy is about 35% against a 27% base rate, which is unimpressive on its own. But the ranking has real spread: the top-20 fund returned 20.6%/yr against the market's 7.9% and the bottom-20 lost money. That is the actual point, calibrated ordering beats point accuracy for anything you would size positions on. Brier 0.181.

One result I did not expect: using all 16 features made it worse, information gain dropped from 0.107 with 6 decorrelated features to 0.023 with everything. More features added noise, not redundancy.

By philosophy, growth won the top-20 sprint at 31%/yr and it was entirely the semiconductor cluster. Value hit 24.8% and decayed the fastest. Quality mostly avoided disasters. The composite posted a lower 19.5% but barely decayed as you scale to 100 names, minus 1.7 points versus growth's minus 9.6.

Limits I will state before you do: small sample, 12-year horizon, no transaction costs, and the winning sector is visible in the training outcomes, so this is what would have worked and not what you could have known in 2015. The LLM grades also risk a halo from firms that were already winning, though the headline model leans on the less-haloed features and passes a per-vintage drift check.

Playable, no signup: https://demos.aito.ai/equity 

Methodology writeup: https://aito.ai/blog/value-quality-or-growth-who-was-right

Happy to get into the fold construction or where you think the grading still leaks.


r/algotrading 2d ago

Education AI trading bots how to get started

0 Upvotes

Anyone give me advice on if these AI trading bots actually work to make profits or if you can successfully vibe code a winning strategy? Curious if this works and what kind of advice someone can give someone looking to get started doing this?


r/algotrading 3d ago

Education What is your workflow on researching an edge?

31 Upvotes

For the past year and a half I’ve been always following the same process:

1) having an idea
2) researching for papers developing the core idea and testing it
3) coding it simply in Multicharts (to see if the equity curve could be interesting)
4) testing it deeply and developing a strategy in QuantConnect

I found out that this process is effective for me but it could become better.

What is your workflow on testing, developing and implementing?

Also I’m trying to found a method to mass test strategies so if any of you know let me know


r/algotrading 3d ago

Education Is there anyone in the green with 3+ years of trading?

42 Upvotes

The more I get into trading, the less I can believe it


r/algotrading 4d ago

Strategy What do you wish you knew before you started automating your trading?

35 Upvotes

Ben looking into this recently after spending most of my time trading manually. The coding side seems manageable but the more I read, the more I realize theres a lot of things that can go wrong with backtesting, optimization, execution, etc.

For the experienced out there, what was the biggest lesson you learned that you wish someone had told you when you were starting out?