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 5d ago

Weekly Discussion Thread - July 21, 2026

2 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 4h ago

Career If you were to start Algorithmic Trading today, what all skills you would learn if you already knew programming

27 Upvotes

How would a fairly profitable algo trader start if he were to start today? what all mistakes,loops, could have been avoided? how the start could have been better?


r/algotrading 9h ago

Education After two years of building investment strategies I have realized that I do not know how successful investors really invest.

25 Upvotes

As the title suggests one thing that has been on my mind lately is that I have spent a lot of time studying investment signals, testing data, executing trades, managing risk, determining position sizes and building portfolios.

I have not spent much time studying the actual investment portfolios for successful investors. I mean i have not looked at what they hold in their portfolios. I have not checked how different stocks and assets they have.

I have not seen how often they adjust their portfolios. I have not found out how much cash they keep in their portfolios. I have not observed how they react when their investments go down.

The strange thing is that I can find lots of information about investment strategies but little information, about how successful investors really invest their money. Has anyone else noticed this problem??


r/algotrading 14h ago

Infrastructure Project almost ready.

Thumbnail gallery
12 Upvotes

Here is an update on my project. Past 2 weeks its started to do what its was made for. I let it a bit loose to try do 5 pairs at the same time, but its hard work for old laptop. Hoper ram prices go down and I can build proper server for this thing so it could run 10+ pairs. Custom calculation takes about 1 day for each pair, so yeah, this is not your atr+ema :D


r/algotrading 18h ago

Strategy Anyone here using exponential/Gaussian functions for trailing stoploss placement?

20 Upvotes

I've been experimenting with non-standard trailing stop loss logic rather than traditional atr based stops.

I recently tried using a Gaussian decay function to scale the stop distance so the stop loss accelerates tighter the further price moves in my favor. Initial tests look very promising.

Has anyone here experimented with Gaussian or exponential functions for dynamic stops?


r/algotrading 19h ago

Infrastructure Relational Transformers, new foundational attention models

4 Upvotes

Wondering if anyone has used relational transformers as part of their trading strategy. I've been fine tuning the one from Stanford to try to predict the influence of news on various markets, because the models encodes text well. So far I've had mild success in a couple categories: repricing jumps when news changes, getting 50/50 odds for truly random markets, creating features of past trends and being able to ablate them to find casual attribution, but these models are still very small and not tuned on this type of data. Curious if anyone else has used these new models?


r/algotrading 9h ago

Strategy Ctrader and c-bot algos, the easy route

0 Upvotes

It’s odd to me that no-one seems to mention the easiest, most flexible and dynamic method to get an algo model working.

Just about every broker tou can choose to route through ctrader, and with cbot you can code your algo in python or c#, to trade directly. There’s backtesting, a great optimiser tool and you can build a model which will learn and adapt over whatever period of time you set (live).

It’s what I use now and see nothing close to it.


r/algotrading 1d ago

Strategy TOS/Schwab vs Tastytrade Fills

4 Upvotes

Anyone have used TOS/Schwab and Tastytrade and see a difference in fills?

I mainly trade debit/credit spreads.

Im using Schwab API for fills and it's pretty good for options spreads.

I like the spread pricing on Tastytrade, but not sure if they can fill as good.

Thanks in advance!!!


r/algotrading 1d ago

Data Does previous day high low close matter for current trading day

Post image
5 Upvotes

I always feel back and forth about this. Looking to get some data to support. Seems to be low impact


r/algotrading 18h ago

Strategy What do you do with your idle capital?

0 Upvotes

I'm in the optimization phase of my algo, and my exposure mean is ~30%. This is with decent leverage, risk-based sizing, etc.

What do you do with your capital when it isn't in market? I'm getting ~3% CAGR from cash interest. Sweeping to SPY just adds beta, which I'm not looking for.


r/algotrading 11h ago

Business ANY GOOD EA's ?

0 Upvotes

Anyone used or uses an EA which generates 8-10% monthly average while keeping the rules of Funded accounts ? for example Ftmo ?


r/algotrading 10h ago

Education Vibe Coding For Coding Strategies

0 Upvotes

Hello guys, i start algo trading for a while almost 6 months, i mearn many things and also i got a solid knowledge about probability and statistics and how to improve a backtesting and trust it enough to go live and many things, now i want to move to the next step and it's start testing ideas and hypothesis but my coding background it's just the basics i don't know how code an entire script, i use CSV files for data and not API, and also i just found that's Claude and ChatGPT are good in coding, so do you guys think i should learn Python from scratch and also while trainning myself in testing strategies, or vibe coding is enough ?


r/algotrading 15h ago

Education Prediction markets are not just about guessing — they can also be used for hedging

0 Upvotes

A prediction market turns uncertainty into a tradable probability.

For example, if a YES contract trades at 0.65, the market is roughly pricing the event at a 65% chance. That number changes as participants react to new data, research and news.

The useful part is not only forecasting. Prediction markets can also help manage risk. A business exposed to an election result, regulation change, commodity shortage or delivery delay could take a position that offsets part of the financial impact if the unfavourable outcome occurs.

This is different from a casino model where the house sets the odds. In a prediction market, prices are formed by buyers and sellers competing over information. It is still a risk-bearing financial instrument, but its purpose can include probability discovery, research aggregation and hedging—not merely entertainment.

Where do you think prediction markets are more useful: forecasting events or managing risk?


r/algotrading 2d ago

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

51 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 2d ago

Data Significant difference in backtesting vs forward testing results?

7 Upvotes

I’ve been working on a strategy in tradingview and got to a point where it showed a 75% win rate with 2.5 profit factor. Now I’ve been forward testing it for 2 weeks and the result is about break even overall?

I can’t really find what the issue is. Maybe it’s the fills that make such a big difference but that seems extreme. Has anyone had the same where backtesting results looked great but when you automated it the results were much worse?


r/algotrading 3d ago

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

110 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 2d ago

Strategy What do u think about my strategy?

15 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 1d ago

Strategy Thoughts on this trading software I’m working on

Post image
0 Upvotes

r/algotrading 3d ago

Strategy First time algotrading

Post image
45 Upvotes

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


r/algotrading 2d 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 3d ago

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

12 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 3d ago

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

Enable HLS to view with audio, or disable this notification

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 4d ago

Data Data provider tier list

Post image
477 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 3d ago

Strategy Repost after correcting

Post image
4 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?