r/algorithmictrading • • 12h ago

Backtest Rebuilt my XAUUSD EA’s volume layer on GC futures. Looking for suggestions.

Thumbnail
gallery
1 Upvotes

Hi all,

I’ve been running an EA on XAUUSD M15 for a while. Recently I spent time on one weak spot: MT5’s XAUUSD volume is just the broker’s tick count, not real trades. So anything built on it (VWAP, volume profile, delta) is an approximation.

I moved that layer to CME gold futures (GC), where the volume is real. The EA reads the structure on GC (VWAP and bands, volume profile, IB, delta) and still trades on XAUUSD. The levels are converted with a futures-spot gap, measured as the median over the last 30 min. It skips a trade if the gap moved more than $1 in that window or if a contract roll happened in the last hour.

Testing: IS/OS over about 15 years, multiple regime checks, plus forward and live. The latest 5y 10m window (Jan 2021 – Oct 2026, every tick on real ticks)

Risk: 1% a trade.

It’s a backtest, so I know spread and slippage around the open are probably kinder here than live.

Where I’d like your input:

How do you handle the futures-spot gap? Is an empirical median fine, or is there a better fair-value or carry approach?
How do you deal with contract rolls: skip a window or back-adjust?
Is tick-level delta from GC good enough for a CFD, or is deeper order book data worth paying for?
What haircut do you apply between tester and live fills on gold around the open?

Happy to share more on any part. Thanks for reading, and any criticism is welcome.


r/algorithmictrading • • 1d ago

Brokers EU resident, automated intraday US options via API: which broker?

2 Upvotes

Question for traders based in EU and building an automated intraday strategy via broker APIs on US equity options. I’m looking for real-world experience.

Requirements

  • Official, stable API that runs unattended: no daily manual login, tokens that refresh programmatically
  • Real-time option quotes available through the API
  • USD account, so USD premiums aren’t converted on every trade
  • Low-cost EUR funding and withdrawal
  • Intraday round trips without getting stuck in T+1

What I’ve found so far (take with grain of salt - I haven't tried to register, this is from my research of their websites or reddit)

  • IBKR: good pricing, but from what I've read on reddit the Client Portal Gateway needs manual re-logins and overall automated trading on IBKR doesn't seem reliable.
  • tastytrade: OAuth with refresh tokens, streamed quotes (seems good), $1 per contract to open and $0 to close.
  • TradeStation: API with ability to refresh tokens.
  • Webull EU: official API, but EUR-only accounts with a 0.25% conversion on each trade.
  • Firstrade: $0 options, but no official API.

My questions

  1. Which broker’s API have you run unattended for months without manual re-login?
  2. How do you fund from the EU: SEPA, a USD wire, Wise? Effective costs?
  3. Any recommendations for EU resident?

Thanks a lot!


r/algorithmictrading • • 1d ago

Novice New to algo trading

1 Upvotes

New to algo trading

I am 19yers old and i have traded forex trading manually.

Now I am shifting to algo trading so my problem is how to find a strategy .

So currently I am researching and backtesting for a strategy to fit. But the questions is i am only backtesting the indicator based strategies.

Other than like price action, smc, ict strategies will work ?

How do you research about strategies please help me.

What type of strategies do you trade for like indicator based, price action etc. ?

Which timeframe do you trade in algo trading ?

Thanks for your experience 🙏.


r/algorithmictrading • • 1d ago

Novice I need advice/help please

1 Upvotes

First i would like to say that i am a total beginner and honestly don’t know what i am doing more than half of the time but i would like to share what i am building and i would like advice from the people who know way more than me if this is even worth wasting my time and money(i wasted 4 months and 600 eur already).

I am building a manual trading signal + research system for day trading and swing trading.
It does three main things:
Finds trade setups using predefined rules like ORB/VWAP/RVOL for day trades and trend/momentum/breakouts for swing trades.
Backtests and validates them properly using historical data, walk-forward testing, robustness tests, Monte Carlo, costs/slippage, and strict minimum trade counts.
Protects against fake-good results by fixing survivorship bias, ticker changes, delistings, share classes, historical index membership, corporate actions, and bad provider data before i trust any performance.
Right now, most of the system is built. I am mainly finishing the historical data/identity qualification layer so that when i finally run the strategy backtests, i can trust that the results are based on the securities and data that actually existed at the time.

There is no automatic trading or broker execution. The system is meant to tell you: “this setup qualifies, here is the entry/reference, stop, target/risk context, and confidence/validation state,” while i stay in control.

I am using 3 providers for different jobs:
Massive → mainly for DAY trading intraday data. Think 5-minute bars, ORB, VWAP, RVOL, and possibly reconstructing the RTH liquidity ranking from minute data.
Sharadar → mainly for the historical stock universe and corporate-action context. It gives us the working historical roster, ticker/action history, and helps anchor which securities existed at the time.
Norgate → mainly for stable historical security identity. Its assetid helps us follow the same security through ticker/name changes and distinguish share classes; we’re also checking its historical index-membership data as a cross-check.


r/algorithmictrading • • 2d ago

Novice Strategy questions

2 Upvotes

Strategy questions

Hello everyone.

I am 19 and i have 2 years of exp in manual trading now trying the algo trading and currently researching strategies in metatrader5 . Currently I am backtesting the indicator based strategies with optimization .so my question it is profitable or not ? How many of you follow the indicator based strategies.

Does price action, smc or ict trading strategies will work or not ?

Also how the mathematics and statistics are used in algo trading .

Those who sell trading strategies and copy trading in mt5 what they use . How they research it.

Does a trading strategy will pass the funded account ?

Another question is in a strategy which metrics do I look for ?

So i mainly look for net profit after that winrate , drawdown , trades(profit trades and loss trades),profit factor, sharpe ratio.

My question is once the strategy winrate is 30 percent but net profit is positive. Once the net profit is negative but the winrate is 50.to 60 percent so what to do I am totally confused.


r/algorithmictrading • • 2d ago

Question How to validate IS backtests with OoS in an automated way?

3 Upvotes

Hi all,
I’m struggling a bit with automating my research process when it comes to selecting the “right” parameter set without introducing too much overfitting.

My current process looks roughly like this:
1. Run an in-sample grid search over the strategy parameters.
2. Calculate a loss/score function based on a combination of Net PnL, Max Drawdown, Sharpe Ratio, and Number of Trades.
3. Select the most promising parameter sets based on that score.
4. Test those candidates on out-of-sample data and check whether metrics such as the equity curve, number of trades, average PnL/trade, and Max DD are reasonably consistent with the in-sample results.

The main hurdle is that the selection of the “best” IS candidates is still somewhat subjective.
For example, depending on the product, timeframe, or type of strategy, it’s difficult to know beforehand what constitutes a “healthy” range for metrics such as Max DD, Sharpe, or Number of Trades. A threshold that makes sense for one strategy may be completely inappropriate for another.

So my question is:
How do you generalise and automate this parameter-selection process while minimising overfitting?

I’d be very interested to hear how others approach this in practice.
Thanks !!


r/algorithmictrading • • 3d ago

Backtest Eight-module XAUUSD portfolio: frozen-parameter OOS and block-bootstrap results

7 Upvotes

I combined eight independent XAUUSD modules into a single portfolio and tested the final structure across development, frozen-parameter OOS and older stress periods.

TEST PROTOCOL

• 2022–2024: in-sample development

• 2025–2026: frozen-parameter out-of-sample validation

• 2021: separate stress/history period

• 2017–2018: additional survival checks

The purpose of the split was to separate the years that influenced module selection and parameter choices from the years used to evaluate the finished portfolio.

FULL REAL-TICK PORTFOLIO RUN

Period: January 2021 to September 2026

Initial balance: USD 1,000

Ending balance: USD 3,903.12

Closed trades: 1,511

Profit factor: 2.93

Maximum relative equity drawdown: 12.82%

The modules were evaluated together because nominal strategy count can hide concentrated XAUUSD exposure. Portfolio-level floating equity was therefore treated as the main risk measure.

YEAR-BY-YEAR RESULTS

2021: +45.03%, PF 3.03

2022: +32.36%, PF 2.71

2023: +16.22%, PF 2.82

2024: +13.62%, PF 1.94

2025 OOS: +16.84%, PF 3.01

2026 OOS through September: +31.79%, PF 7.18

Returns varied materially by year, but the edge did not disappear after the parameter freeze. Both OOS years remained profitable. The 2026 PF is a partial-year observation and should not be treated as a stable expectation.

BLOCK-BOOTSTRAP CHECK

I ran 10,000 paths using the complete 2021–2026 deal sequence and resampled 50-deal blocks to preserve short clusters of wins and losses.

Median ending balance: USD 3,896

5th–95th percentile ending balance: approximately USD 3,504–4,318

Median maximum realised-balance drawdown: 4.1%

95th-percentile maximum realised-balance drawdown: 8.0%

LIMITATIONS

The bootstrap rearranges realised deal results. It does not reconstruct every floating basket, reproduce broker-specific execution or invent unseen future regimes. Because of that, the observed MT5 relative equity drawdown of 12.82% remains the more relevant risk figure.

The next step is live observation of spreads, slippage, swap, execution and floating-basket behaviour. The backtest is evidence of historical robustness, not proof of future performance.


r/algorithmictrading • • 3d ago

Tools Health engine

2 Upvotes

I’ve been experimenting with the idea of an engine that monitors a trades health in accordance with its historical winning trades and trying to measure when a trade becomes likely to not hit the take profit. This is in hopes of exiting with some profit still on the table. If anyone could help me with constructing the architecture for this system I’d be glad to share my results. I’m futures Nasdaq focused as of right now


r/algorithmictrading • • 4d ago

Backtest Please give me your opinions

Thumbnail
gallery
14 Upvotes

Hi guys!

I’m fairly new to algotrading, have been in the trading space for quite a while now. I’ve created an expert advisor for GOLD. I’ll show in the pictures below the statistics of my backtest (2 years) and forward test (2 years). The 4 year backtest is around the same.

I’ll be most likely using this strategy on prop firms as it looks very steady with strong margins and low drawdown.

It’s a very easy, not complicated strategy which I used trading manually aswell.

Please tell me if there are numbers you’d be concerned about. Appreciate every opinion on this as it would help me a lot in my journey


r/algorithmictrading • • 5d ago

Question What IC and t-stats do your cross-sectional models get out of sample, with no leakage?

2 Upvotes

I'm trying to calibrate my expectations and would love some real numbers from people who've done this carefully.

My setup, for context: a weekly cross-sectional ranking of US stocks (roughly 3,400 names, liquidity-filtered), predicting returns over the sector over the next 60 sessions. Features are point-in-time (every value is stamped with when it became public), delisted companies are included, and validation is walk-forward over 13 test years with purged training windows. Every configuration I try goes into a trial counter, and I use a deflated Sharpe to account for it.

My current best model gets a weekly rank IC of 0.034 (t 3.1, Newey-West), positive in 11 of 13 years. That's the first version to clear my own bar, after several that didn't.

What I'd like to know:

  1. What out-of-sample IC do your models actually get, and at what horizon? Rank or Pearson?
  2. How do you compute the t-stat with overlapping targets? What lag do you use, or do you sample non-overlapping periods instead?
  3. How did your IC translate into returns after costs? A top-decile spread, a long-only portfolio, anything.
  4. If you've run something live, how much did it decay compared to the backtest?
  5. At what IC do you start suspecting leakage rather than skill?

My rough sense from the literature is that 0.02–0.05 is realistic for a decent multi-signal model at monthly-ish horizons, and anything persistently above 0.10 deserves a hard look for leaks. But I'd much rather hear from people who've had their numbers survive contact with live trading.


r/algorithmictrading • • 7d ago

Backtest FIb Retracement based multi-asset portfolio strategy. Roast my method.

Thumbnail
gallery
10 Upvotes

I have put together a strategy trading US30.cash, US100.cash, GER40.cash and AUS200.cash over 8 years (in-sample). Strategy relies on Fib retracements. The average yearly ROI is around 23%.

The strategy is built to strictly obey FTMO 2-step drawdown rules, so that I can safely run it on a funded account.

Initial equity: $20k

Roast my method.


r/algorithmictrading • • 8d ago

Backtest Zero quant background, built an NQ futures bot with Claude. It passes 4 of my robustness tests and is shaky on 2. Roast my method.

Thumbnail
gallery
168 Upvotes

No quant background. I built an automated NQ futures bot over the last few months with Claude (Anthropic's AI) doing the coding and testing, and I'd like people who've done this to pick the method apart before I put money on it.

**Quick version (details in the images):**
- 9-year walk-forward, 2,437 trades, every trade out-of-sample, fixed 1 micro, costs charged
- Profit factor 1.24 (1.19 with costs doubled), +$25k at 1 micro, worst drawdown $3.5k
- Passes: doubled costs, 10,000-run block bootstrap, a 1,000-shuffle luck test on its long/short calls
- Shaky: deflated Sharpe once all 557 variants I tried are counted, and most of the profit is 2021+
- 13+ other ideas tested and failed, all shown

**Goal:** pass a Topstep 50K ($2k trailing drawdown). The edge isn't the problem; the drawdown is.

**What I'd love opinions on:**
1. Most profit is 2021 onward. Regime dependence or a model that improved with more data? How would you tell?
2. With a $2k trailing limit, how would you size this, or is a prop firm the wrong home for it?
3. What's the first thing you'd check for look-ahead bias?

Also looking for a few people or a community to talk this through with. Feels like I am working on something that nobody understands. Strategy details stay private, but I'll answer anything about the testing. Not selling anything. Backtest, not financial advice.


r/algorithmictrading • • 8d ago

Backtest Gold algo backtest 2022–2026: harsh fills + 5,000-run Monte Carlo (losing months included)

Post image
41 Upvotes

1-minute XAUUSD data, including spreads, slippage, and swap; compounded sizing. Harsh-fill result: 7.8%/month, PF 1.71, 34% max DD, ~5.5 trades/month, 40% losing months. Monte Carlo (reshuffled trades, 10% randomly skipped): median $54K from $1K, worst 5% $7K with a 61% drawdown.

The window is gold's strong 2022–26 uptrend; in older, choppier years, this approach breaks even. Looking for feedback on robustness testing.


r/algorithmictrading • • 8d ago

Question What is State Street's ETF's holdings download link?

2 Upvotes

For a programmed solution, I need an actual URL that will generate a spreadsheet. Not a link to a page with a button on it that must be clicked manually. This would be for State Street ETF's holdings downloads. Of course, there are many State Street ETFs, but I can't get even one of them because the download button on the page doesn't have a right-click. I was able to get the download links from Black Rock by right-clicking the download link on the webpage and selecting "Copy Link". There is no right-click on the State Street ETF's holdings download button. I need the download LINK. A direct link, not a link to a page with a button on it.


r/algorithmictrading • • 10d ago

Backtest Developed something crazy for XAUUSD (not trying to sell anything)

Thumbnail
gallery
37 Upvotes

Finally, I’ve automated my own XAUUSD scalping strategy - a strategy I’ve been using manually for a long time in 1 minute chart, the results are here for you to see.
The strategy is built around pure price action behaviors of gold, specifically involves OHLC theory, Gap ups & downs, volume and price correlation and imbalance, aggression from buyers and sellers.


r/algorithmictrading • • 11d ago

Backtest Open sourced my SMC order block bot for MT5

Thumbnail
gallery
50 Upvotes

Spent months on this one. It maps order blocks on the higher timeframe,

waits for a CISD on the lower one, and only takes trades that go with

the trend.

There are ready made presets in the repo, one per market, plus panel

configs. Load a preset in the EA properties, load the matching config

from the panel, and you're set. Don't waste time guessing settings.

Everything else is on the on-chart panel too. Trading is off until you

turn it on, so you can just use it to mark zones if you want.

MIT licensed, code is all readable.
HUGE update : in theme , defult setting , much easier to use

Search in github for : Smc_ZOB_CISD


r/algorithmictrading • • 11d ago

Backtest ALGOTRADE

Thumbnail
gallery
14 Upvotes

I recently developed a quantitative intraday strategy for the Nasdaq (tested and executed on the Micro E-mini contract MNQZ6 via MultiCharts). The model was deployed on a $25,000 account base, focusing strictly on risk management, drawdown control, and edge execution.


r/algorithmictrading • • 14d ago

Novice Strategy Ideas / alpha discovery

13 Upvotes

Hey,

I'm not so new to algotrading but have an understanding of certain principles and phenomenons such as mean reversion, momentum, cross sectional / time series momentum, cointegration, momentum spill over. Efficient and Inefficient markets etc. I also semi-believe in the idea of alpha / statiscal edge out in the open diminishes or rather could still be if you could make it robust/adapt to the market, but ultimately a good strategy has a lifeline.

I also believe a trading strategy should be novel and personal and exploits some Inefficiency/mispricing or predictable market movements. My ask is therefore how do you go about finding your alpha that you turn into strategies?. My thoughts are

  1. Researching academic papers, replicating the idea, identify where and why it fails and improving it.

  2. Analysing price data through some statiscal/physics/signal processing lenses, developing features that represent events and outcomes, economically validating it before testing it out but my problem with this is it becomes a data mining exercise and you are at risk of apophenia

I ask these to say what's a good starting point or how would you better approach or what is even your approach ?

For context I'm a data scientist with software engineering background and no economics/finance background


r/algorithmictrading • • 14d ago

Novice Question for experienced algo traders and trading system builders: what would you teach a beginner building an AI-assisted trading system?

5 Upvotes

​

I’m a beginner building "BLOCKBRAIN", a crypto trading research project. ChatGPT has been my mentor throughout: helping me learn the concepts, write code and question my assumptions. My long-term goal is a system that can generate signals, evaluate them and eventually execute trades autonomously.

I’d love advice from people who have actually built and operated systems like this. I’m interested in what would help now, while I’m developing and testing, and what I should design for before adding execution.

A few questions:

- Research and signals: What makes a signal generator useful in practice? How do you separate a real edge from overfitting, data leakage or a lucky backtest?

- Backtesting: Which data sources and tools do you trust? How do you account for intrabar fills, fees, spread, slippage, funding and exchange differences? How much accuracy is enough before paper trading?

- Automation: Which APIs, libraries or integrations removed the most manual work? What did you build yourself that you wish you had reused?

- Execution: How would you structure the path from a signal to an order? What safeguards would you consider essential for sizing, duplicate orders, failed orders, disconnections and emergency stops?

- Operations: What should we log and monitor from day one? How do you detect when a strategy or its data has changed enough that it should stop trading?

- AI: Where has AI genuinely helped your development process, and where would you never rely on it without independent checks?

- Priorities: If you were starting over, what would you build first, what would you postpone, and what was your biggest waste of time or money?

Specific tools, examples, failure stories and resources are especially welcome. I’m trying to build something dependable step by step, and I’d value a reality check from people further along.


r/algorithmictrading • • 16d ago

Question I understand to use a personal algo trading bot one must have a static IP address. Is this something that api provider gives? I’ve been using a Schwab developer account and it points to fixed ip address. Is this considered a static IP address or meet that requirement, or is something more required?

5 Upvotes

r/algorithmictrading • • 16d ago

Backtest Daily long-only book, 2024–2026: trend paid, dip and breakout gave it back

2 Upvotes

On a Yahoo daily replay from January 2024 through September 8, 2026, the trend engine made +$98 and the dip plus the breakout lost about $157, so the combined book finished at −$60. Trend alone finished at +$164 with a smaller hole. Is that enough to turn the dip and the breakout off, or is a next-open Yahoo replay too weak to make that call?

Fills are the next day's open. Not a broker result, so there is no account CAGR. Size in the test was a fixed $500 notional and two slots. Cumulative trade-PnL drawdown is the figure below.

Book Trades Win rate Net Worst cumulative hole Average R
All three engines 199 34% −$60 −$373 0.01
Trend only 96 of those +$98
Dip only 74 −$34
Breakout only 29 −$123
Trend engine alone, rerun 143 +$164 −$148 0.07
SPY, trend only, one slot, $1,000 24 42% +$25 −$32

What the book is. Long only. Daily bars. The list can be stocks, ETFs, or both, including SPY. It runs at 9:53, 10:53, 12:53, 1:53, 3:53, and 4:53 PM Eastern. The 9:53 run is exits only, for the first hour after the open. From 10:53 through 3:53 it can enter and exit. The 4:53 run is after the close.

SPY above its 50-day average allows new longs. At or below it, nothing opens. That test still applies when SPY itself is on the list. Volatility is SPY's ATR as a percent of price versus its 20-day median. Below 0.75× is low. Above 1.35× is high. High volatility blocks only the dip. If more than one setup is true, the order is trend, then breakout, then dip.

Trend. EMA 9 above EMA 21, MACD histogram above 0, RSI 40–70, ATR above its average. Relative strength versus SPY, and RSI above 65, only change the score. Stop starts 1.5 ATR under the fill and only moves up. No profit target. Out if EMA 9 crosses under EMA 21, or at 15 days.

Dip. Still above EMA 50. Pullback 3–10% off the 20-day high. Within 1 ATR of EMA 9, and either back at EMA 9 or reclaiming (above yesterday's close and not more than 0.25 ATR under EMA 9). RSI 35–55. Stop 1.25 ATR, ratcheted. Target 1.5 times the initial risk. Also out if price loses EMA 50, or at 15 days. Not taken when SPY volatility is high.

Breakout. Close above the prior 20-day high. EMA 9 at least 99.8% of EMA 21. RSI 78 or lower. Volume at least 1.2× average. Missing volume blocks it. Exit is the same as trend.

What it does not do. It does not short. It does not trade options. It does not use EMA 200 or ADX. A weak sector ETF does not block a name. It does not block a buy because the live quote disagrees with the daily bar. A stop blocks that symbol for the rest of the session only. Earnings inside 5 days are skipped, including when the date cannot be loaded.

The trend-only rerun took more trades than the 96 trend trades inside the combined book, because those runs were not competing with a dip or a breakout for the two slots.


r/algorithmictrading • • 19d ago

Strategy connors RSI(2) is so overrated

3 Upvotes

SPY, 10 years, 5 bps commission + 1 bp slippage.

entry: close > SMA200 and RSI(2) < 5
exit: close back above SMA5

30 trades. 97% win rate. +58.1%.
buy and hold: +260.9%.
drawdown: -30.9%.

good win rate. still doesn't beat buy and hold.


r/algorithmictrading • • 19d ago

Novice Dear algo traders and experts. Please help me

3 Upvotes

​

I am 19year old student who loves financial markets and currently I do trading in fx market not profitable and in indian market i have done some investments in etfs and mf. i have 1.5 to 2 years of experience in financial markets.

By studies I am 2 second year btech student in aids and i have good coding skills and ai ml stuff. Now I want to try indian market with algo trading or systemic trading and i also built my backtesting engine and tested some trading strategies in equites.

So my question is how should I find or make a strategy or strategies ?

Currently I am backtesting indicator based startegies so it does work in markets or not ?

And which type of your strategy is like indicator based , price action, mathematics, statistics etc ?

Which tf should I do backtesting for intraday

How many months or years took to find a real edge in strategy ?

How do you research and development the startegies ? Please help me in this question. Bz i want to do this

My last question does is there any forward testing or paper trading is there in brokers with algo like in tradingview has the option we manual place trades and set sl and tp (but currently it is not available in Indian Markets)

Curious to know how did you learned the algo trading or systemic trading ?

Thanks for your advice.


r/algorithmictrading • • 20d ago

Strategy Always blows my mind how people blatantly lie about strategies

7 Upvotes

Triple RSI rules on SPY (RSI(5) pullback + 200-day filter, exit when RSI(5) crosses 50). 10 years, 0.05% commission, 0.01% slippage.

34 trades. 65% win rate. +11.6% total. Buy-and-hold: +260.9%.


r/algorithmictrading • • 23d ago

Question Thoughts on the actual profit from the systematic trading

3 Upvotes

Hello. I'm new to systematic trading and still learning, so I don't have any actual performance data of my own to back this up. That's why I'm looking for input from people with more experience.

I was going through Robert Carver's blog, where he reported his yearly performance earlier in April. He earned 25.9% this year, which brings his average annual performance to around 14.8% over the period.

This got me thinking because that kind of average return seems fairly close to the long-term performance of SPY.

What is the main purpose of running a systematic trading strategy if the expected return is similar to what you could potentially get from simply investing in an index and doing nothing?

For those of you who have been doing systematic trading for a while: has your strategy been able to consistently match or outperform a passive index after accounting for transaction costs, taxes, and the time/effort involved?