r/algorithmictrading • • Aug 04 '26

Novice How can I automate my mean reversion strategy

7 Upvotes

So I’ve been manually backtesting a strategy for NQ during Asia and London session. It consist mainly of 3rd std deviation of the vwap and 9 EMA close. I could elaborate further but how can I automate this strategy as it’s at early morning to midnight from were I’m from to trade this strategy. Can anyone help?


r/algorithmictrading • • Jun 30 '26

Question beginner to statistical modeling

7 Upvotes

Right now I am thinking of starting a project regarding MCMC or Bayesian networks, for I am not sure what I should look into. My goal is to create a very rigorous model that will provide risk analysis as accurately as possible. Im willing to spend around 10k for compute power, is this possible?

Also, I am an undergrad pursuing a math of comp and statistics data science major, but I would not say I am a master at probability, and I do not have much experience in ML. I am willing to learn, but do you think its feasible for me?


r/algorithmictrading • • Jun 24 '26

Backtest I backtested the 3 most boring textbook rules over 20 years (7 assets, net of fees, Monte Carlo) — where they beat buy & hold and where they got wrecked. Roast the method.

7 Upvotes

Before anything fancy, I pressure-tested the boring baselines over a real multi-regime window — and I'm posting the failures, not just the wins.

Rules (one fixed rule each, nothing fit to the data):

  • Trend: long while price > 200-day SMA, else cash.

  • Momentum: long while trailing 6-month return > 0, else cash.

  • Mean-reversion: long when price < lower 20-day Bollinger band, else flat. All act on the next day's close (no lookahead).

Data: Yahoo daily adjusted, ~20 years (equities since 2005, BTC since 2014) — spans 2008, 2020, 2022. Fees: equities 0.03%/side, crypto 0.40%/side, charged only on trade days. Block-bootstrap Monte Carlo (2,000 paths) for path-luck bands.

What held up:

  • The trend filter roughly halved max drawdown on every equity/crypto market over 20 years (SPY −21% vs −55% B&H, QQQ −27% vs −53%, BTC −71% vs −83%) — at the cost of lagging raw return. Classic risk reduction, across real crashes.

  • The one return-and-risk win: trend on NVDA, +100,038% vs +84,447% buy & hold, −54% vs −85% drawdown. (Single-name survivorship — flagged.)

Where it failed (shown, not hidden):

  • Long Treasuries (TLT): the overlay barely cut drawdown and missed the bull (+2% vs +85%).

  • Mean-reversion got run over on gold and lost −66% on BTC.

  • Momentum lagged badly on small caps.

Caveats I know (tell me the ones I don't): hand-picked liquid survivors (selection bias), daily-close fills + flat per-side cost (no intraday slippage), no parameter optimization, and 20yr is still short for strong claims.

What I'm asking:

  1. For long/flat systems, your preferred risk-adjusted metric when cash days deflate vol — Sortino, Calmar, exposure-adjusted?

  2. Reasonable crypto cost model — flat taker per switch, or maker/limit fills?

  3. What would make you trust a "halves drawdown" claim — rolling windows, regime splits, walk-forward OOS?


r/algorithmictrading • • Jun 09 '26

Novice Deconstructed the 5-minute noise: How I built a 4.6M row ML trading pipeline using XGBoost and a Rust limit sniper. Need architectural feedback.

7 Upvotes

I’ve spent the last few months building an automated pipeline to capture edge on 5-minute BTC binaries on Polymarket. I started this as a broke CS student, and after hitting a wall with standard lagging indicators, I ended up building a decoupled architecture: a Python **XGBoost Inference Server** and a low-latency **Rust Execution Orchestrator**.

The math is finally working outside of backtests, but the data gravity and infrastructure costs are hitting a hard ceiling. I want to get some eyes on my setup and tear down where my architecture or logic might be weak.

1. The Data Footprint (4.6M+ Rows)

The pipeline relies heavily on high-frequency feature engineering. Across my local rig and a few cheap tier AWS instances, the database and storage footprint currently breaks down into:

* **\~197,000 High-Quality Snapshots:** Fully processed training state spaces (the "flashcards"). * **\~1.55 Million Raw Tick Rows:** Continuous 5-second market snapshots stored in Parquet. * **\~3.06 Million SQLite Rows:** System logs, execution tracks, and tracked whale wallet movements.

The features completely ignore standard OHLCV. Instead, they isolate Binance Order Book Imbalance (OBI) at 5 deep levels, aggressive market order flows ("Whale Delta" > $50k blocks), and real-time funding rate shifts.

**Here is where I might be overcomplicating things:** To avoid a lazy model in a trending market, I’m strictly class-balancing the dataset to a rigid 50/50 UP/DOWN split by throwing out excess majority-class samples before training. *Are there better ways to handle regime bias on ultra-short timeframes without tossing out perfectly good data?*

2. Bypassing the Spread via Rust (ethers-rs)

On a 5-minute horizon, crossing the bid-ask spread with market orders is a suicide mission. To solve this, I wrote a custom **Limit-Sniper in Rust**.

When the Python model generates a signal with an AUC > 0.85, it triggers the Rust module via a local socket. Rust handles the cryptographic signing and dispatches Maker orders to the Polygon RPC in sub-millisecond times, placing limit orders right at the mid-price.

3. Live Paper Results & The Kelly Math

After violently scrubbing out a look-ahead bias a few weeks ago, I enforced a brutal testing standard: a mandatory 1.5¢ spread penalty on entries, full 2% fee accounting, and absolute hard expiration settlement.

This yielded an out-of-sample test win rate of **55.3% (AUC: 0.87)**.

For the live forward-test, **I locked the system to a tiny $10 paper wallet and forced it to use a strict Fractional Kelly Criterion algorithm** to size bets safely based on its 55.3% edge.

Over a multi-day continuous run, the bot executed **31 automated trades**. Because it was constrained by the $10 wallet, the Kelly formula restricted bet sizes to tiny micro-positions (roughly $0.50 to $1.00 per trade) to prevent risk of ruin. It closed out with a net PnL of **+$2.04**. While $2 sounds like pocket change, mathematically, it represents a **20.4% return on bankroll** over just 31 trades.

4. The Infrastructure Wall (Where I need your take)

Right now, I am running continuous **Walk-Forward retraining** on the XGBoost model. Because the market shifts so fast, I’m retraining every single night on the newest 180k+ daily snapshot state space.

Honestly, it’s completely melting my local GPU/VRAM limits, and my student bank account is gasping for air trying to keep up with the AWS data egress and computing bills. I've engineered the hell out of this code to keep it alive on zero budget, but I’m maxing out the physical limits of what a student setup can execute.

A few specific questions for the sub:

  1. **Retraining Frequency:** Is daily walk-forward retraining overkill for an XGBoost model on a 5-minute horizon, or am I just begging for overfitting if I space it out to weekly?

  2. **The Python -> Rust Handoff:** Right now I'm using local sockets to pass signals from the ML server to the Rust sniper. Is the overhead from Python's socket handling going to ruin my sub-millisecond execution when I scale up?

  3. **Kelly Scalability:** The Fractional Kelly formula is perfectly tuned for a micro-wallet ($10). When scaling up to actual production capital, do you find that liquidity constraints on Polymarket alter the optimal Kelly fraction significantly due to order book slippage on larger sizes?

The core math and alpha are holding up cleanly, but I'm flat out of compute power and budget to move this out of the staging sandbox and launch it live.

If anyone wants to collaborate on optimizing the data pipeline, talk infrastructure, or discuss how to back and scale a pipeline like this out of a dorm room environment, my DMs are open.

Tear the architecture apart. Let me know where I'm being stupid. 🚀


r/algorithmictrading • • Jun 03 '26

Strategy Does this prove my strategy would work?

7 Upvotes

So this is an update, before i developed the system and proved it was profitable over the years raw. After which I used order flow data to estimate slippage, but i had only order flow data for a short time during 2021-2022, and a few months of 2026, the average slippage at entry I got from the data was around 2.7 ticks during the 2021-2022 period and an astonishing 3.7 ticks in 2026.
I'm not sure why its that high, the bot is on GC and runs on all sessions. Now even with these abnormal high slippage rates the bot was profitable during those years, but if the same slippage was applied to weaker years, the edge became less strong.
Now another thing is that I don't know what the slippage would be like before 2020. So I basically don't know what slippage I should apply.

The conclusion I came up with was collecting data on limit entries instead, I used the order flow data to find that about 97.5 percent of the trades got filled in. So the current version Im showing in the picture is the execution logic of placing a limit on the signal price, and in 97.5 percent chance that it will fill (that percentage is not of all trades, but of all winning trades). Now because i only have order flow data from the dates i mentioned, I used the same metrics on the whole other history.

Now I understand that especially before 2020 the fills would be inaccurate, and this does not represent an accurate history backtest. So instead im trying to prove that the future would work, the concept raw without fees or slippage had very consistent results over the years, so the concept would work, its only a question of if the fills back in the day would allow the bot to be traded at that time.

So overall This result should be the most accurate way to predict future results. At least that's what my thought process was. Everything before 2021 is out of sample btw.


r/algorithmictrading • • May 31 '26

Question Regime Detection With Near Accuracy

7 Upvotes

I have been working on my algos and I noticed one-piece of the puzzle is missing and I believe can help me greatly - Ability to detect market regime with high precision.

I am currently using RSI, ATR and Vol to define regimes but it has not significantly improved my strategy.

Am I going on a wild goose chase or it is something feasible?


r/algorithmictrading • • May 27 '26

Tools Beginner backtester from scratch and literature paywall

7 Upvotes

To avoid the AI slop comments i wrote it by hand.

I have a personal proyect which is build a python backtester, to learn since the beginning how it works.

In the backtester there is, montecarlo/permutation to see wr, profit factor and return(P-values), equity curve with filter regime below it to show if with high ADX shuts the strategy down, and finally OOS equity curve.

I am also going to implement walk foward matrix, heatmap for parameter sensivity analysis, sortino, sharpe, deflated sharpe and calmar ratio , profit and recovery factor, purged and embargoed cross validation and hidden markov

Any tips for the backtester?

My code only backtest it doesnt use any portfolio management as i dont have any startegies and in case you are wondering, yes i do have the regime filter to do a mean reversion for market in range and also a trend following if imbalanced(I just realized i dont have any data cleaning writing this)

As a beginner i want to learn the theory behind things and have been browsing for literaturebut all of the recommended are expensive, is there any web or recommendation for a typical "bible" of quant knowledge?

You can ask any questions if you want to, i really don't know if this post is decently explained as i don't have much knowledge.


r/algorithmictrading • • May 26 '26

Question What I've learned about strategy verification from some honest feedback.

7 Upvotes

I asked recently what would make people here trust a third-party strategy verification report. The feedback was much more useful than I expected, so I wanted to summarize what I learned and ask a more concrete follow-up. The biggest takeaway: "A pretty report is useless if it cannot be reproduced". Several people pointed out that trust comes from things that are hard to fake:

- exact data slice
- exact parameter set
- reproducible OOS / WFO trail
- clear slippage assumptions
- regime-segmented results
- parameter sensitivity surfaces
- explicit kill criteria
- code-level reproducibility where possible

That changed how I think about the report. A useful strategy failure report probably should not be a PDF that says: “Looks promising.” It should be closer to an evidence package that says:

“This is what was tested.”
“This is what assumptions were used.”
“This is where the strategy breaks.”
“This is what should be retested.”
“This is what remains unverified.”
“And under these conditions, do not deploy.”

One comment that stood out to me was that trust comes from things that are not easy to fake: git hash, exact data slice, parameters, WFO windows, and the ability to reproduce the same trades. That makes sense.

Another strong point was that slippage sensitivity should not be a single number. A report should probably test optimistic / realistic / conservative execution assumptions and show how quickly the edge decays.

Same with regimes. Aggregated performance is not enough if the strategy has a hidden dependency on one market condition. So the report structure I’m now thinking about is:

  1. Reproducibility layer
    Exact inputs, parameters, data slice, test window, and assumptions.

  2. Backtest integrity layer
    Leakage risks, unrealistic fills, transaction cost assumptions, lookahead/survivorship issues.

  3. WFO / OOS layer
    Per-window performance, retention ratio, drawdown, trade count consistency, and degradation across windows.

  4. Parameter sensitivity layer
    Whether performance sits on a robust plateau or a sharp overfit peak.

  5. Regime layer
    Performance across bull / bear / sideways / volatility regimes, not just aggregate results.

  6. Execution stress layer
    Slippage, spread, partial fills, latency, liquidity, and broker/exchange mismatch.

  7. Data snooping guardrail
    What was changed, how many times, what data was touched, and what remains unseen.

  8. Kill / revise / monitor / paper verdict
    A clear decision, not soft-positive language.

The more I read the replies, the more I think the value is not “third-party trust me bro.” The value is a reproducible second-opinion system that makes failure harder to hide. I’m currently testing a very early MVP for this. Curious that if you were testing a sample report, what would be the minimum evidence required for you to take it seriously?

Would you care more about:

- reproducibility?
- slippage sensitivity?
- WFO/OOS structure?
- parameter sensitivity?
- regime segmentation?
- live/paper diagnostic feedback?
- explicit kill criteria?

Also, would you rather test this on:

A. a toy/sample strategy
B. your own strategy with anonymized inputs
C. a known public strategy
D. a failed live/paper strategy

And would you paid for this if you see it helpful on your algotrading journey at some points? Trying to understand what the first useful version should actually include.


r/algorithmictrading • • May 23 '26

Question Built an intraday ML system, found my backtest was 100% in-sample. Out-of-sample it’s pure noise. Where do I go from here?

7 Upvotes

TL;DR: I built an intraday ML system to predict 5-minute direction on 20 liquid US equities. Cross-validation AUC was ~0.51 (basically a coin flip), but my backtest was showing Sharpe 7–11. Turned out the backtest was training and testing on the same date range — 100% in-sample memorization. After enforcing a strict chronological train/test split, out-of-sample performance collapsed to noise (avg Sharpe -0.74, 42% win rate, statistically identical to feeding the backtester random signals). Posting the full story because the leakage hunt was instructive, and to ask: where’s the realistic path to actual edge from here?

What I’m trying to do
Short-horizon (intraday, ~1 hour holding) directional prediction on liquid S&P 500 names. Enter long/short on a model signal, exit on a fixed take-profit / stop-loss / time-stop. Paper trading only — no real money has touched this, and after this week it’s clear why that was the right call.

The stack
•Language: Python 3.12
•Model: LightGBM, one model per ticker (20 separate models)
•Historical data: Polygon.io (5-minute bars)
•Execution / paper trading: Alpaca
•Universe (20): AAPL, MSFT, NVDA, GOOGL, META, JPM, GS, BAC, AMZN, TSLA, HD, JNJ, UNH, XOM, CVX, CAT, BA, SPY, QQQ, IWM
Features (~98, all price/volume-derived)
The usual technical arsenal computed on 5-min bars:
•Momentum/trend: returns over multiple horizons, EMAs (9/21/50/200) + crossovers, MACD (line/signal/hist + normalized)
•Oscillators: RSI (7/14/21), Bollinger %B / bandwidth / squeeze
•Volume: volume MA/ratio, log dollar volume, OBV proxy, plus ~13 order-flow features (buying pressure, wick imbalance, body ratio, etc.)
•VWAP and distance from VWAP
•Volatility: ATR(14), realized vol over several windows, vol regime/percentile
•Time-of-day / session flags (open/close auction, lunch, minutes since open)
•Market-relative: returns/strength vs SPY, beta proxy, correlation
•Event proximity: hours to/from FOMC, NFP day, CPI week, OPEX week

Labels
Binary direction. A bar is labeled “long” if the forward return over the next 12 bars (~1 hour) exceeds ~2× the recent rolling volatility and the drawdown along the way stays limited (a “clean directional move”); “short” for the mirror case; unlabeled otherwise. Roughly a third of bars get a label.

Exits
Fixed rules, mirrored exactly between backtester and live paper trader: +1% take-profit, -0.5% stop-loss, 12-bar time exit, and a stall exit if the trade goes nowhere. Intraday only — no new entries in the last 30 min, force-close before the bell.

The part that bit me
Early backtests looked incredible: Sharpe 7–11 across nearly every ticker, 85–90% win rates. The problem: my cross-validation AUC during training was only ~0.51. That contradiction is impossible to ignore once you see it — a model with 0.51 AUC has essentially no predictive power, so it cannot produce a Sharpe of 11 honestly.
I worked the problem in stages:

1.Same-bar entry. The backtester was entering on the same bar as the signal instead of the next bar. Fixed (entries now fill at T+1). Helped, but didn’t explain the gap.

2.Scaler leakage. The feature scaler was being fit on the full dataset including the test folds. Fixed to fit on training data only. AUC dropped slightly (good — more honest), but the backtest was still showing Sharpe 9+.

3.Null test. I overwrote the model’s predictions with random coin flips and re-ran. Random signals produced ~41% win rate and deeply negative Sharpe across the board — exactly what a correct backtester should do with no signal. So the simulation mechanics were clean. The fake edge had to be coming from the model somehow.

4.The actual bug. The model was being trained on the entire feature file, then backtested over the identical date range. 100% overlap. The “predictions” in the backtest were the model reciting labels it had memorized during training. CV AUC (0.51) was the honest out-of-sample estimate the whole time; the backtest was pure in-sample replay.

The fix was a strict chronological split: train on everything up to a cutoff date, backtest only on the held-out period after it.
Out-of-sample results (the honest ones)
Held-out period the model never saw (~5 months): •Average Sharpe: -0.74
•Average win rate: 42%
•Total PnL: slightly negative
•For reference, the random-signal null test produced ~41% win rate. So the trained model is, out of sample, statistically indistinguishable from random.

A handful of tickers showed positive Sharpe (one at ~1.9), but on 25–50 trades over 5 months with +0.2–0.3% returns — almost certainly noise you’d expect from 20 tickers by chance.

What I think the lessons are:
•A backtest that disagrees with your cross-validation metric is lying to you. Trust the harder-to-fool number (out-of-sample AUC).

•The single most valuable thing I built this week wasn’t a feature — it was a null/random-signal test and a strict temporal split. They turned an impressive fantasy into an honest zero.

•Adding fancier features to an in-sample backtest would have been pointless; it would have shown Sharpe 11 regardless.
Where I’m stuck / questions for the community

1.Is intraday directional prediction on liquid equities just not feasible with price/volume features alone? My read is that ~98 OHLCV-derived features are all re-derivations of the same information and there’s no directional alpha left in them at this horizon. Is that consistent with others’ experience?

2.Pivoting from direction to volatility. Direction looks near-random, but volatility clusters and seems far more predictable. Planning to re-target the model at “will the next hour be high- or low-volatility” and trade sizing/options off that. Has anyone found this to be a meaningfully easier prediction problem in practice?

3.Which non-price data actually moves the needle? Considering (a) news sentiment, (b) microstructure (bid-ask spread, order imbalance), (c) options flow / put-call. For those who’ve added these — which gave a real, out-of-sample improvement versus which were noise?

4.Per-ticker vs single pooled model. I’m training 20 separate models. Would pooling into one cross-sectional model (with ticker as a feature) likely help, given each model is data-starved?

5.Horizon. Are 5-minute bars simply too noisy? Would moving to 15-min or hourly improve signal-to-noise enough to matter?

Happy to share more detail on any piece. Mostly looking for honest “here’s what worked / here’s what was a dead end” from people who’ve actually gotten an intraday system to hold up out of sample.


r/algorithmictrading • • Apr 28 '26

Novice How to test if the strategy itself is profitable

7 Upvotes

Hi guys, i am a newbie algo trader. What do you guys do when testing a new strategy that you want to experiment on? How do you test its profitability? Do you input a fixed stop loss and take profit? Or do you just test it on stop and reverse exits like signal based?


r/algorithmictrading • • Apr 21 '26 Galaxy Brain

Backtest Crypto backtest window selection: same strategy, three periods, three completely different results

Thumbnail
gallery
7 Upvotes

Been running the same strategy across different lookback windows and I'm not sure what to conclude.

1Y: CAGR -10.1%, Sharpe -0.32
3Y: CAGR +33.7%, Sharpe 0.41
5Y: CAGR +18.5%, Sharpe 0.18

As a benchmark out of curiosity I used BTC+ETH 50/50. The uncomfortable part is that none of these is obviously wrong. The 1Y window captures a genuine drawdown period. The 3Y catches the recovery and the bull run into 2024. The 5Y includes 2022 which was one of the worst years in crypto history by basically any metric.

If you handed me only the 3Y chart I'd say the strategy works. Only the 1Y and I'd say it's broken. They're the same strategy.

The issue I keep running into with crypto specifically: unlike equities where you can argue a 20-year window captures multiple full cycles and smooth out regime noise, crypto barely has coherent "cycles" in the traditional sense. Each major epoch had different market structure - the 2021-2022 period had leverage and correlation dynamics that don't really have a precedent, and probably won't repeat identically. The 2023-2024 recovery was partially ETF-driven. You're not just looking at different returns from the same market. You're looking at different markets that happened to share a ticker.

So the standard advice: "just use more history" - doesn't obviously help here, because you're stacking structurally different markets on top of each other and calling it one dataset.

Genuinely don't have a clean answer. Walk-forward is the obvious move but crypto doesn't give you enough history to run folds that actually mean something, you get maybe 2-3 non-overlapping periods if you're being honest, and one of them is 2022. Regime-conditional testing sounds right in principle, but then you have to define what a regime is without using returns to do it, which is a harder problem than it looks.

How do you handle this? Do you just pick a window and stick with it, or do you actually try to separate results by market regime?


r/algorithmictrading • • Mar 13 '26

Question Fastest API for SPX options chain (0DTE + near-ATM) with low latency?

7 Upvotes

I’m building a trading system that needs to pull the SPX options chain with specific filters, and I’m struggling to find a provider that is both fast and actually real-time.

What I need:

  • SPX options chain

  • Only 0DTE expirations

  • Only near-the-money strikes (around spot)

  • Ideally <1s latency

  • Streaming or very fast requests

The issue I'm running into:

  • Some providers give true real-time data, but the API response time is very slow (5–12 seconds) which makes it unusable for intraday options trading.

  • Others like Polygon(massive) return responses very quickly, but the data is delayed by ~2 minutes, which is completely unacceptable when paying for market data that is suppose to be live!

For context this is for systematic trading, so pulling the entire chain and filtering locally is not ideal due to speed.

What I'm looking for:

  • A provider that can deliver SPX options data quickly

  • Ability to filter expirations / strikes efficiently

  • We don’t mind paying if the data quality and latency are good.

If anyone here is running algo strategies on SPX options, I’d really appreciate hearing what data providers you're using.

Thanks!


r/algorithmictrading • • Feb 10 '26

Question How much edge is enough to go LIVE ?

7 Upvotes

So if I have strategy which I backtested it with 1000+ trades in a period of say 5 years. And if the breakeven win rate for that strategy is 60% and if my backtest reveals 63% then is 3% edge enough to go live ? All backtest parameters are inline with live trading parameters. .


r/algorithmictrading • • Dec 10 '25

Backtest Honest Feedback for rookie

Thumbnail
gallery
7 Upvotes

r/algorithmictrading • • Dec 04 '25

Backtest Is this too good to be true?

7 Upvotes

Im pretty new to Algo trading but i have computer science background .I trade one Gold contract. I know trading view is not the best place to backtest. But my strategy is based on limit orders and i keep the limit orders 4-5 candles before the execution of the trade. But the sortino ratio is too good to be true. all my previous strategies were having poor sortino and sharpe ratio. is this some glitch or is it usual to see these kinda results? im anyway settong up my server to test this o n a demo account


r/algorithmictrading • • Dec 03 '25

Question Stuck on part of my backtesting engine

Post image
7 Upvotes

Currently working on a backtesting software and I’m not receiving any response on websocket from the engine. Does anyone have any experience or advice, I would have to show codebase if you have experience.


r/algorithmictrading • • Nov 30 '25

Quotes Best site to get live OHLCV data (not interested in historical data beyond 2 days)

7 Upvotes

I'm working on an algo which needs live OHLCV data, and historical data only for the last 2 days. (As you might have guessed, it's an algo for scalping). I'm currently using yfinance for stocks/futures and coindesk/cryptocompare for crypto. While this works okay, yfinance has delayed data, and cryptocompare has limited calls/month.

Is there a reliable one-stop (paid) service which can provide me live data for stocks, futures, and crypto? I have an account with IBKR, but haven't explored their API yet.

What do people recommend?


r/algorithmictrading • • Nov 04 '25

Strategy Need advice from professionals for confidence or caution

Thumbnail
gallery
7 Upvotes

So I have been working on a stratagy for like 1.5 years I know almost everything it takes but I have several questions :

  1. Is good results on walk forward testing enough to confirm no or minor overfitting

  2. Are the results and metrics in my backtest reasonable like should the risk be toned down or somting else I your mind (I made this bot for acummilative growth only I dont plan on withdraws in first 3 years or so)

  3. I have done live testing on demo before in 4 months it was around 250 usd in 4 months on 500 usd starting balance I saw nothing suspicious in that period after that i improved some minor things in code and am currently running another live test again actualy in a trade right now ,the trade frequency is low but high in success similar as backtest (most trades around mid of the year).

  4. My lot size automaticaly increases iand doubles evertime balance doubles hence the exponential looking returns I am looking to get to a 10000usd account and then dramaticaly lower the risk if i start live should i do that if i reach 10000 ever or leave it (risk) as is or only lower is slightly cuz of my win ratio and recovery factor.

Feel free to call out my delusions.

ty


r/algorithmictrading • • Oct 14 '25

Question OB & Trade data Algo

7 Upvotes

Long time lurker first time poster.

Been working with deep orderbook and trades analysis on crypto tokens (BTC & ETH). I am currently utilising EMA'S with a 5h decay as I feel OB and trade data is more relevant to short term price movements.

I have found that orderbook imbalance slope tends to have a decent correlation to price movement and trade spikes particularly aggressive (market order) trade spikes tend to indicate significant moves but I am struggling to capitalise on this algorithmically due to the noisy nature of the data I am processing.

Questions for this community:

  1. Does anyone here have any suggestions for advanced data processing of noisy websocket feeds? I have tried Kalman filtering but it is still too noisy

  2. Is orderbook and trade analysis a genuine edge that most people ignore because it is too difficult to extract the edge? If so I am patient and willing to do the grind necessary to extract this edge

  3. Is orderbook and trades processing strictly limited to short term edge or is there long term potential and implementing a longer term EMA decay would fix my noise issue? If so simple problems have simple solutions.

Thanks in advance, any insight is greatly appreciated!


r/algorithmictrading • • Sep 30 '25

Data How can I get more data to backtest?

Post image
7 Upvotes

I spent about 8 months planning, manually backtesting, then coding this to actually bt it, but I am a high school student and do all my backtesting on ninjatrader demo with proper slippage/ commisions but the data i get is limited ~ 2-3 months

I have some databento credits but backtesting using python to backtset is a headache and the fills on ninjatrader are pretty accurate as i use stop orders but still am using 1 point slippage to be on the safer side.

How/where can i get some data? any website/torrents?


r/algorithmictrading • • Sep 23 '25

Novice Is algorithmic trading worth it..

7 Upvotes

I am a 3rd-year student here. Tried TA trading — didn’t vibe with it. Now I want freedom: digital nomad life, location-independent income.

Torn between: Freelance in AI/ML** → scale skills, build products, lower risk, faster income.
Go all-in on algo trading** → if it works, ultimate passive freedom… but brutal failure rate, takes years.

If you’ve walked either path — what’s the smarter move for sustainable freedom?
Can I combine both? What’s the real timeline, stress, and payoff?

No hype — just your honest take.


r/algorithmictrading • • Sep 04 '25

Jobs I have excellent buy signals.. and can someone help write a good sell code in python..

7 Upvotes

Looking to team-up.. Here are my indicators.. which work flawlessly for buys.. need someone to help or provide ideas to write a fluid sell signal instead of fixed gain.. look at the 1st and second line for good buy signals. you will realize what I am saying.. if it works i can share my buy signal details.


r/algorithmictrading • • Aug 31 '25

Strategy Stoploss recommendation

7 Upvotes

I am currently developing a trend following system in python, and for the most part it is working good. I ran it on a demo account and it made 10 dollars consistently every day, after all the losses. My system uses atr to fix sl at the start of the trade and after certain conditions are met, the sl is set to breakeven. There is no tp as it is a trend following system.The strategy and everything is working well, but I need another indicator or tool for calculation of sl, to make comparisons on my current system and optimise it further.

I am using metatrader5 pip module and connecting mt5 terminal to my vscode.


r/algorithmictrading • • Aug 13 '25

Backtest my strategy's performance against SPY using walk forward testing/training also question about calmar ratio

Post image
7 Upvotes

==== Backtest Stats ====

starting_balance: 100000.0

ending_balance: 159039.8745181389

total_pnl: 59039.874518138895

total_return_pct: 59.039874518138916

days: 1394

sharpe_252: 1.2770408359708052

trades: 684

winning_trades: 305

losing_trades: 278

avg_trade_pnl: 100.40794986078043

avg_win: 704.4256669427747

avg_loss: -560.4674600698106

win_rate: 0.5187074829931972

max_drawdown_pct: -10.622539881797763

calmar_ratio: 1400.611204488416

profit_factor: 1.3789223540638214

Let me know how I can rigourously check this bot to see if it works, monte carlo simulations come to mind, but I also want to take this live. Some things I would like to update are the years it tests/trains on using walkthrough. Im building this for free so I'm using alpha vantage for 25 calls per day of 15 minute intraday data (every day I get a couple years more, currently using 2015 jan to 2019 feb with first 60 days unusable)

Please give me tips on next steps testing etc, I've been working on bots for a while but this is the most promising.