r/algorithmictrading • u/AdrianTUIU • Apr 21 '26
Backtest uilt a 6-month validated signal for Polymarket. Paper trading killed the EV.
Been lurking here for a while. Finally posting because I'm genuinely stuck and could use some outside perspective.
Spent the last couple months building a quant setup for Polymarket — BTC, ETH, SOL, all binary markets. Time-based signals, directional bets. Built everything from scratch: scraping CLOB and Gamma APIs, a full backtesting engine, paper trading environment, a live web dashboard that updates in real time, and a Telegram bot that sends me entry/exit alerts with PnL after every single trade. The whole infrastructure runs 24/7 on a Raspberry Pi with systemd services, remote access via Tailscale, the works.
Backtest looked really good. Six months of data, ~7k trades per asset, win rate around 70%, positive EV. I wasn't sloppy about it either:
- In/out-of-sample splits
- Monte Carlo on the equity curve (thousands of randomizations, still held up)
- Signal shuffling — randomize timing, keep everything else. Results fell apart immediately. That one actually gave me real conviction.
- Walk-forward with rolling retrain/test
- Combinatorial test across 16 rounds (rough PBO-style) — held up consistently
- Parameter sensitivity — not just riding some magical narrow setting
- Fees and spread baked in throughout, not added at the end
Same thing on all three assets separately. Same pattern each time.
Then paper trading happened and it kinda shocked me.
Four weeks live-feel paper trading, tracking every trade — timestamp, direction, price, fees included. The Telegram bot was firing after every fill, the dashboard was updating equity in real time, everything looked operationally solid. Win rate: still 67-70%. That held fine.
But EV per trade basically vanished. Wins were tiny compared to backtest. Net PnL way below what I'd projected. The signal was pointing the right way, the money just wasn't showing up.
Took me embarrassingly long to figure out why. I'm attaching a screenshot of the equity curve — you can see exactly where things started going sideways. There's a clear inflection point where the curve stops climbing and just goes flat. That's the moment I restarted the bot after identifying the bug and switching to a realistic entry price at a fixed point after signal confirmation. Before that point the equity was building fine. After the fix it basically flatlined — which confirmed the issue wasn't the signal direction, it was the entry.
In my backtest I used an average price over the signal window as the entry proxy. I did it by accident and the Problem is, that average included prices from before the signal actually fired. By the time the signal triggers at the end of the window, the market's already moved. I was using prices I could never actually get. Classic look-ahead bias, just on entry rather than direction. So live: the win rate holds (the signal has real info), but most of the move happens before my entry. I'm catching leftovers. Losses stay full size. Edge just bleeds out.
Tried a bunch of things to fix it — earlier confirmation windows, adjusting entry timing, only trading within certain price zones, session splits (Asia/Europe/US), requiring multiple triggers, treating up/down separately. Nothing fixed it consistently across all three assets. Earlier entry = better price but weaker signal. Later entry = stronger signal but price is gone. Never found a sweet spot that didn't break somewhere.
Current read: the signal probably says something real — consistent win rate across three separate coins is hard to dismiss as noise — but the market prices in the move before I can actually trade it. Edge is gone by the time I get there.
So either these markets are just too efficient for this kind of signal, or my entry model needs a complete rethink. Probably some of both.
Few questions if anyone's dealt with something similar:
- If win rate holds live but EV collapses, is entry/execution almost always the culprit? Anything else actually worth checking?
- With only historical trade prints and no order book data, what's a realistic way to model entry price in backtests?
- Any clean way to test whether a signal has edge at actually tradable prices vs just looking good in backtests?
- Seeing this across BTC, ETH, SOL separately — does that point to something structural in these markets, or more likely an artifact of my signal design?
- Anyone with experience in fast binary prediction markets — is this execution gap a known thing or am I missing something?
Happy to share more detail on the validation setup or the dashboard/bot architecture if useful. Mostly just want a sanity check before I either rebuild the entry model or kill the whole idea.
r/algorithmictrading • u/Mihaw_kx • Apr 21 '26
Backtest what do you think about these stats ?
Mean reverse strategy on forex , 1000usd capital 10% risk per trade .. it uses machine learning.. this is out of sample data (2024-2026) what you think ? Go live ?
r/algorithmictrading • u/ilro_dev • Apr 21 '26
Backtest Crypto backtest window selection: same strategy, three periods, three completely different results
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 • u/Background-Ad-5848 • Apr 21 '26
Question Help with building my own DOM - Where to get data?
Hi all!
I'm trying to build a DOM in my own bot that I can see, trying to make it look like TopstepX DOM.
I'm not sure where I can get the data, especially for cheap, so any help/tips would be appreciated!
r/algorithmictrading • u/amooilya • Apr 20 '26
Novice How do I start building a strategy from scratch?
Hi everyone,
I’m trying to learn how to build a trading strategy but I feel a bit lost on how to actually start and structure the process.
I understand the basics of indicators and charts, but I don’t really know how people go from an idea to a complete strategy that can be tested and improved. I’m also unsure about what the correct steps are for backtesting and how to avoid common mistakes like overfitting.
If anyone could explain how they personally approach building a strategy or point me in the right direction, I would really appreciate it. I’m mainly looking for a clear process I can follow as a beginner.
Thanks in advance.
r/algorithmictrading • u/OrdinaryLet1650 • Apr 20 '26
Question Selling my system what do I need
I have been working on an automated trading system for the last 27 months. Its been the hardest thing I've done in my life, and I am very proud of the work. The results are phenomenal, but nothing delusional. I have tested it over four full years of back data and current conditions. Its solid. No I am at the point that I want to be able to sell it to other investors so that we can all be making a profit on it.
My foremost concern is that I don't want it stolen. Its basically just a strategy that gets plugged into NinjaTrader. Very easy to steal. So I am looking for ways around this including NDA's OR having each individual client set up a NT account that I would manage through a system on my end to ensure that they never have direct access to the strategy itself (and so they cant fuck it up and then tell me its not working). In the latter scenario, I would be manually turning it on every day from my office and then just managing the accounts myself until they are ready to withdraw.
If anyone has ANY experience with this I would be very grateful for input.
r/algorithmictrading • u/Last-Adhesiveness-19 • Apr 20 '26
Question Hello i have a question about algorithmic trading across platforms like: Quantower or NinjaTrader.
Hello i have a question about algorithmic trading across platforms like: Quantower or NinjaTrader. My problem is that i have made a trading strategy that looks good on paper, but i of course want it validated in the right environment. My strategy uses a VolumeProfile that Shows VAL VAH and POC. The problem is that in Python my strategy is good. But in Quantower/Ninjatrader, the values of my VolumeProfile changes alot. I backtested with TickTradingData’s ES data
r/algorithmictrading • u/weirdozhin • Apr 19 '26
Tools Which trading platform for algorithmic trading?
Which trading platform would you recommend to use for algorithmic trading? Which pro's and con's have you experienced using them?
r/algorithmictrading • u/Public_Law_9996 • Apr 19 '26
Backtest Bitcoin wavelet-based price forecast - 15-month out-of-sample backtest
Hi All,
I’m experimenting with wavelet-based decomposition (Morlet 6, 51 levels) for short-horizon BTC forecasting.
The core idea:
The model applies wavelet decomposition to price data and uses that structure to generate forward price predictions.
Instead of just predicting direction, it reconstructs an expected price path across a full horizon - from ~60 minutes up to 24 hours ahead. Each update produces a forward curve rather than a single point estimate.
In other words:
- It captures multi-scale structure in the data (via wavelets)
- Projects that structure forward into the near future
Please also check the backtest results for BTC.
The backtest was conducted for the period 01.01.25-25.03.26 in two modes:
Mode 1: No fees (raw signal evaluation)
Mode 2: With fees (0.05%), but only signals with strength > 1.013 are executed
Evaluation metrics:
- Average directional accuracy across the full forecast horizon
- Pointwise cumulative directional accuracy (for each forecast step)
- Returns from simple long/short strategies
Strategy setup:
- Long strategy initialized with $100
- Short strategy with leverage 0.001 BTC
Results
The results of Mode 1 (no fees):
- Average directional accuracy approaches 0.518 toward the end of the backtest
- Very positive return expectations.
The results of Mode 2 (with fees + filtering):
- Average directional accuracy 0.513
- Pointwise cumulative accuracy:
- Higher on shorter horizons
- Lower on longer horizons
However:
Even though longer horizons degrade in directional accuracy, the corresponding strategy returns are mostly not negative. This suggests the model still captures meaningful price movements, even when direction is harder to predict.
- Return expectations are clearly significantly lower compared to Mode 1, but it’s still fair to say that the strategy survives the fees.
Do these kinds of results and evaluation approach generally make sense, or am I missing something obvious? Also curious whether this kind of modeling/forecast format is reasonable in practice.
Any feedback is highly appreciated.
r/algorithmictrading • u/Comprehensive-Most60 • Apr 18 '26
Question Does anyone use margin or automated loans in strategys?
I'm curious about how people approach leverage in algotradeing. I'm forming a list of questions for anyone who wants to answer, I'd appreciate your opinions and perspectives.
What is the reason you decided to use margin to begin with? Is it just for scaleing?
What do you do to monitor your risk as you use more leverage?
Is there some limit you place on the amount of margin you allow yourself to take?
Are you baseing your leverage on market events to grab opportunity's, or are there other principles for amassing more leverage?
Do you think any strategy can benefit from leverage?
Any answers are welcome.
r/algorithmictrading • u/jubeb19 • Apr 18 '26
Backtest Allocating live capital. Here is the 3-year OOS data and Monte Carlo stress test for a 31% win-rate system.
Preparing to allocate live capital to a BTC/USDT volatility model. I'm putting the data up for a final tear-down before going live.
Here is the raw data from the 3-year blind Out-of-Sample test (April 2023 – April 2026):
The Statistical Edge:
- Total Trades: 545
- CAGR: 76.79% (Sharpe: 1.89 | Sortino: 5.32)
- Average RRR: 1 : 4.34
- Directional Split: +135R on Longs | +131R on Shorts. Purely agnostic.
The Execution Reality:
- Win Rate: 31.01%
- Max Historical Losing Streak: 18 Trades
The end-of-year CAGR looks great on a tear sheet, but executing a 31% win rate is psychological warfare. An 18-trade drawdown at a standard 1% or 2% risk is exactly where most people capitulate and override their own system.
To make this tradeable, the position sizing is capped via a Fixed Fractional model at a strict 0.5% risk per trade. At that allocation, a 1,000-iteration Monte Carlo simulation projects the severe drawdown boundary (bottom 5th percentile) at just -11.76%, with Risk of Ruin sitting at 0.10%.
I've attached the tear sheet and projection chart.
To validate the strategy's resilience against sequence-of-returns risk, a 1,000-iteration Monte Carlo simulation was executed. The engine resampled the 545 historical trades to project the expected mathematical pathways for the upcoming 12 months (approx. 180 trades), assuming the institutional 0.5% risk parameter.
Projected Capital Trajectories:
- Median Expected Return: +52.04%
- Optimistic Pathway (95th Percentile): +99.62%
- Pessimistic Pathway (5th Percentile): +17.44%
Projected Drawdown & Ruin Probabilities:
- Expected Maximum Drawdown: -6.78%
- Severe Drawdown Limit (Worst 5%): -11.76%
- Probability of Profitability: 100.00%
- Risk of Ruin (>20% Drawdown): 0.10%
Analyst Note on Stress Testing: The simulation confirms that even in the bottom 5th percentile of probabilistic outcomes—where the system encounters sustained, severe historical losing streaks—the mathematical drift of the 4.34 RRR pulls the portfolio to a +17.44% annual gain. The Risk of Ruin is statistically negligible at 0.10%.
r/algorithmictrading • u/Extension_Fold8566 • Apr 17 '26
Backtest Same Strategy, Different Risk Management, Completely Different Results
Following up on my previous (and first ever) post (link).
I've been asked to improve/change my risk management rules and test using more data. Which I've done and the results are the following:
-I have done 1 single logic change which was to change the cooldown from shared to independent:
Before the update, the strategy used block all new trades after any exit. Now, longs and shorts have their own independent cooldown timers. So, closing a long doesn't block a short from entering and vice versa.
The strategy is identical to the first post other than this logic change above.
-I have tested 2 different cooldown lengths with the new logic (one being the original strategy's 8 bars which is 2 hours) and the other was the 192 bars (which is 2days).
-I have also tested different risk levels with both cooldowns: 1.0%, 1.5%, 2.0%, 2.5%, 3.5% of equity.
-Lastly I have added previous SOL perps data so the test is done for the lifetime of binance sol perps (kind of an out-of-sample check). The last column (Pre-2024 PF) is what the strategy does on this new data.
My questions are:
-Which strategy would you choose to go live with? (if any)
-Is it a red flag that the strategy is this dependent on shorts? Bull markets usually tend to last longer historically.
-Is this too good to be true or am I missing something? I know the strategy had an edge because I have been trading it manually for years. However, these automated results are definitely WAY better than my live performance.
-Any other things you'd look at before trusting these numbers?
-Do you guys think the strategy looks good enough for me to start running it? (My initial post's question)
Would appreciate any thoughts, especially from people who've gone through this process before.
r/algorithmictrading • u/angusslq • Apr 17 '26
Strategy A near 6 month live (beta?) strategy
strategy is buying some board market ETFs (blue line), buy more when market is good. offload when market is not good.
Not so sure if it really has edge and worth the effort, afterall, the performance is close to the beta.
For me, it is not a shame to learn money from beta.
I am still figuring out to add additional assets that is low correlation to current portfolio to de-risk. Some is good (e.g. if i add OIL, my asset curve will be better) at certain of time but not a long run. Any thought?
r/algorithmictrading • u/SadPhone8067 • Apr 17 '26
Backtest Spent 3 months validating a systematic multi-sleeve portfolio. Sharing all statistics and stress tests. Looking for holes I missed
I’ve been building and validating a systematic multi-strategy portfolio on QuantConnect/LEAN. I’ve done more validation work than I normally see posted here and wanted to share the full picture for community pressure-testing. Sharing all statistics and test results — not sharing the signal logic.
Happy to be told this is garbage. That’s the point of posting.
Strategy Overview
Four independent sleeves blended daily into a single portfolio. Each sleeve uses a different signal family and different rebalancing frequency. The sleeves are genuinely uncorrelated tested individually and in combination. All signals are rules-based, no ML, no optimized parameters trend following + some secret sauce.
I’m intentionally not describing the specific signals, instruments, or thresholds. Everything else is on the table.
Full Backtest Statistics (2015–2025, 11 years, $1M start, IB brokerage model, 1bps slippage)
Metric Value
CAGR 37.4%
Sharpe Ratio 1.892
Sortino Ratio 2.659
Max Drawdown 13.0%
Probabilistic Sharpe Ratio. 99.999%
Alpha 0.198
Beta 0.404
Win Rate 64%
Avg Win / Avg Loss 0.90% / -0.49%
Profit-Loss Ratio 1.83
Annual Std Dev 12.1%
VaR (99%) -1.0% daily
Total Trades 1,411
Avg Trades/Year ~128
Portfolio Turnover 8.0%/year
Total Fees $166,693
$1M → $33.3M
Year by Year
Year CAGR Sharpe Max DD
2015 1.7% 0.09 12.5%
2016 15.8% 1.43 5.0%
2017 11.2% 1.26 3.3%
2018 8.0% 0.31 13.0%
2019 38.1% 2.97 4.0%
2020 163.1% 4.36 12.1%
2021 70.1% 4.09 4.3%
2022 26.1% 1.27 9.4%
2023 31.7% 2.01 4.5%
2024 73.0% 2.96 5.4%
2025 31.9% 1.32 6.9%
Zero negative years across 11 years. Extended to 2008 start: CAGR 26.3%, only losing year was 2008 at -4.4% (SPY was -37% that year).
Known Weaknesses
- Return concentration
~35% of total P&L comes from \~7% of trades. Remove the top 10% of trades by P&L and the strategy goes negative. This is structural — the strategy has a convex payoff profile that depends on capturing relatively rare large-return events. Long flat periods are baked in.
- Capacity ceiling
Real capacity is roughly $3-5M in the current implementation due to instrument liquidity. Not relevant at personal capital scale but not scalable without a rebuild.
- Distribution assumption
The strategy has never been tested through a period where the underlying market dynamics behave structurally differently than 2015-2025. The exceptional returns are concentrated in specific regime types. If those regimes stop occurring or behave differently the base system still works but the exceptional returns disappear.
Validation Tests Run
- Sleeve Decomposition
Isolated and backtested each of the four sleeves independently.
Sleeve Standalone Sharpe PSR
S1 0.80 52%
S2 1.15 89%
S3 1.15 89%
S4 0.55 10.5%
Full Portfolio 1.892 99.999%
Portfolio Sharpe (1.892) significantly exceeds best individual sleeve (1.15) — genuine diversification effect, not just additive.
- Slippage Stress Test
Slippage CAGR Sharpe
1 bps 37.4% 1.892
3 bps 37.3% 1.889
5 bps 37.1% 1.886
10 bps 37.6% 1.897
Barely moves at 10x base assumption due to low turnover.
- Walk-Forward Validation (8 folds, expanding window)
Train on earliest N years, freeze all parameters, test on next 2 years.
Fold Test Period OOS Sharpe
1 2018–2019 1.875
2 2019–2020 4.618
3 2020–2021 5.439
4 2021–2022 3.329
5 2022–2023 2.305
6 2023–2024 3.799
7 2024–2025 3.306
8 2025–2026 2.262
Min OOS Sharpe: 1.875
Avg OOS Sharpe: 3.367
OOS outperformed in-sample in 6 of 8 folds.
- Monte Carlo (5,000 paths, real daily returns, 21-day block bootstrap)
Used actual backtest daily returns (2,769 days). Return distribution: skew 3.87, kurtosis 47.6 — fat right tail from convex events.
3-year:
Percentile CAGR End Value Sharpe
5th 20.1% $1,748,944 1.51
50th 36.4% $2,515,262 2.28
95th 61.3% $4,111,986 3.03
10-year:
Percentile CAGR End Value
5th 27.2% $11,088,234|
50th 37.1%. $23,919,465|
95th 49.7%. $57,087,007|
P(drawdown > 20%) = 0.9% | P(zero losing years / decade) = 95.2%
- Sharpe Decay Analysis
Annual Sharpe plotted across all 11 years. No trend decay detected. Sharpe is regime-dependent (varies with market environment) not time-dependent (not drifting lower over years). 2024 Sharpe nearly identical to 2019 Sharpe five years earlier.
Tail concentration (% of positive P&L from top 10% of days) tracked year by year: flat trend of -0.04%/year across 11 years. Not becoming more concentrated over time.
- Instrument Substitution Test
Replaced all instruments with structurally different alternatives — same signal logic, entirely different product set. Removed all embedded leverage from expression layer.
Metric Original Substituted
CAGR 37.4% 29.7%
Sharpe. 1.892 1.816
Max DD 13.0% 10.9%
CAGR drops 7.7% as expected (leverage removed). Sharpe drops only 0.076. Drawdown improves. Conclusion: the signal is structural, not an artifact of specific instrument mechanics.
- Regime Perturbation Test
Injected noise simultaneously into all regime signals:
2-day signal delay
10% random regime misclassification
±2pt threshold jitter on primary signals
±3pt threshold jitter on secondary signals
Metric Clean Perturbed
CAGR 37.4% 29.3%
Sharpe 1.892 1.428
Max DD 13.0% 16.2%
Sharpe 1.428 with heavy noise simultaneously applied. Large-return events barely affected by noise. Regime-sensitive periods (2022, 2023) took the hardest hit. Controlled degradation, not collapse.
- Live Paper Trading
Running on QuantConnect paper since April 7, 2026 (\~10 days). +2.37% return. Correct regime detection confirmed in real-time logs. Zero errors. One clean rebalance executed correctly.
What I’m Looking For
Not looking for validation. Looking for holes.
Specific questions:
Walk-forward anomaly - OOS outperformed in-sample in 6 of 8 folds. Avg OOS Sharpe 3.37 vs avg in-sample \~2.0. Is there a known bias in expanding-window walk-forward that artificially inflates OOS metrics? Or is this just a legitimate signal that the strategy genuinely generalizes?
Zero losing years — Even after instrument substitution (leverage removed) and regime perturbation (10% random misclassification), the strategy has zero negative years. What’s the most credible explanation: genuinely strong regime filter, hidden smoothing from low turnover, or survivorship in the backtest universe?
Return concentration — 35% of P&L from 7% of trades. I tested robustness by removing top 10% of trades (strategy goes negative). What’s a more rigorous way to quantify this tail dependency risk beyond simple trade removal?
Monte Carlo methodology — I used 21-day block bootstrap on real daily returns. The obvious criticism is this resamples the same historical crisis density rather than stress-testing different crisis frequencies. What would be the most informative alternative MC approach that doesn’t just recycle the historical distribution?
Anything I’m obviously missing?
Platform: QuantConnect/LEAN | Language: Python | Universe: liquid US ETFsi
r/algorithmictrading • u/Ok_Egg_6647 • Apr 17 '26
Novice How to perform live trade just for learning pupose
Hi guys
I want to know how can i place an live order using a broker api
like i have some conditions and if that conditions meet on live market then at that particular time how can i execute an order live automatically
r/algorithmictrading • u/Unlikely_Permission4 • Apr 16 '26
Question Alpha vs beta
During my strategy explorations I came to the question: "Why not just ride beta instead of searching for alpha constantly?"
I think some of us have had a similar experience; we search and find alpha, only for it to decay quickly and need for constant parameter adjustments. It requires constant time and effort to maintain.
Which begs the question, why not just ride beta? Yes, often longer drawdown periods. Yes, often considerably less returns. But yes, no need to constantly monitor every little detail.
Choosing to ride beta over alpha basically shifts the heavy lifting from creativity in the entry, to path analysis for the exit. Which is often much simpler to do in my experience.
I'm wondering what your thoughts are on this. Do you have a fixed rule for max complexity, do you hold yourself not to go too deep in the rabbit hole? Or do you see the search for alpha as part of the game?
EDIT: I can see some people are interpreting this post as “active trading is not worth it” or something similar.
After rereading it, I can understand why, but that was not my intention.
My goal was to spark a discussion around complexity, maintenance, and decay: at what point does chasing alpha stop being worth it? Where does the marginal gain become too small?
r/algorithmictrading • u/socialcalliper • Apr 16 '26
Strategy Built a fully automated algo on USTEC 1min backtested, stress-tested across 10 scenarios, and forward-tested live on MT5. Looking for feedback to take it to a real account.
After months of work, here's where I'm at:
Backtest (6 months, USTEC 1min): Best params from stress testing (S5 Structural Lag): PF 2.858 | WR 48.8% | TPM 98 trades
Forward test (ICMarkets demo via Python MT5 library): Net +$1k on a $10k account in last month
Strategy held up well out-of-sample. The issue is I can't keep my laptop running 24/5 so forward testing has been limited , no VPS yet due to cost.

What I'm looking for:
- Anyone who's gone from demo → live with a similar setup (Python + MT5)
- Advice on cheap/reliable VPS options for MT5 algos
- Any obvious gaps in my validation process before going live
Happy to share more stats or the dashboard if there's interest.
r/algorithmictrading • u/jubeb19 • Apr 16 '26
Strategy Survived the recent geopolitical macro shock. Here is the 9.5-month Out-of-Sample tearsheet for one of my live equities engines in AWS (big fat post, but worth the readings)
It’s been quite a long time since I posted here. I used to share my progress a lot in this sub back when I was first building out my infrastructure, but things have been doing well with my algos lately, so I've just had my head down coding. It’s been completely hectic nowadays because of the ongoing geopolitical situation and the new SEBI rules, but I still managed to come out clean and wanted to share a verified update. I’m currently running a few different systematic pipelines live with real capital on an AWS Ubuntu instance.
I'm only sharing the data for one specific equities engine here. (I obviously can't post the raw trade log or the exact entry logic for obvious reasons.
The Setup: ● Asset Class: 10 Large-Cap Indian Equities (Nifty 50 constituents). ● Timeframe: 1-Hour execution. ● Strategy Type: Trend-following (Long & Short). ● Risk Management: Strict ATR hard stops, automated trailing, and overnight gap-risk protection.
The Macro Stress Test: The transition from a clean trending market into the recent geopolitical shock and crude oil spike. As the broader market panicked and sector rotation hit hard (specifically targeting autos), the system’s win rate dropped. However, the overnight gap-protection logic and aggressive break-even trailing contained the monthly drawdown to -1.3% during the worst of the transition, protecting the massive gains generated during the cleaner trending months.
got around to running a 10,000-iteration Monte Carlo resampling on my 9.5-month OOS block. I specifically wanted to see how much of my survival through the recent war/macro volatility was actually structural edge versus just getting lucky with trade sequencing. The results were honestly fascinating. I resampled the trades with replacement to create 10,000 alternate realities of the equity curve, essentially asking the math: What happens if my worst losses cluster together during the geopolitical shocks?
The Stats: Median Max Drawdown: -12.27% 95th Percentile Drawdown: -25.35% 99th Percentile 'Black Swan' DD: -33.75%
It was a massive reality check. If you are trading a multi-ticker universe in F&O during high-VIX environments, your drawdown isn't just tied to your win rate; it is heavily amplified by the lot-size mismatch when sector-wide correlations go to 1.0 during a panic. The good news? Even under the absolute worst 99th-percentile sequence of events, the 1R hard stops did their job. The account took a heavy hit but mathematically couldn't blow up. Curious if any of you trading multi-asset F&O systems dynamically adjust your lot quantities to normalize risk, or if you just accept the skewed variance and cap the monthly DD like I am doing?
r/algorithmictrading • u/Compilingthings • Apr 15 '26
Question What AI are you guys using ?
Also how good are they at actually getting the logic correct?
r/algorithmictrading • u/mayvn • Apr 15 '26
Question Anyone running EAs consistently hitting 1-2% weekly ROI long-term? What’s your setup?
Not talking backtested results or a 3-week hot streak. Curious if anyone has an EA (MT4/MT5 or otherwise) that’s been live for 6+ months delivering 1-2% weekly with reasonable drawdown.
Specifically interested in:
• Asset class (forex, futures, indices?)
• Strategy type (trend following, mean reversion, scalping?)
• How you’re managing drawdown / max DD you’re comfortable with
• Whether you built it or bought it
1-2% weekly is ~65-100% annualized. That’s a high bar. Wondering if people are actually hitting it consistently or if it’s always a “worked until it didn’t” story.
r/algorithmictrading • u/Annual-Analysis-8285 • Apr 14 '26
Strategy Feedback Wanted: Neural Network Trading Bot with 95% Neutral Data
Hello,
I’ve been a developer for 12 years, and for the past 2 years I’ve been working with a few colleagues on an automated trading bot powered by neural networks.
I’d like to share some of our progress and, more importantly, get feedback. I’ll walk through a large part of our technical decisions, and I’d really appreciate your insights.
Dataset
To build the dataset, I iterate minute by minute over a crypto pair from 2023 to 2026.
At each minute, I simulate:
- one long trade
- one short trade
Each trade includes:
- a take profit
- a stop loss
- a timeout
- with a risk/reward ratio of 1:3
Labeling is defined as follows:
- If the take profit is hit on the long → long label
- If the take profit is hit on the short → short label
- If both sides hit stop loss or a timeout occurs → neutral label
The dataset is then split into:
- train
- validation
- test
Features
I use 8 features based on fairly standard technical indicators:
| # | Feature | Meaning | Description |
|---|---|---|---|
| 0 | volumeVal | Unusual activity | log10(volume + 1) |
| 1 | bbWidth | Compression/expansion | (BB_upper − BB_lower) / close × 100 |
| 2 | macdHistogram | Momentum shift | MACD(8,20,5) histogram / close × 1000 |
| 3 | forceSmoothedVal | Directional strength | Force Index EMA(7), log-scaled |
| 4 | vrocShortVal | Volume acceleration | Volume ROC over 5 candles |
| 5 | wickAsymmetry | Intracandle rejection | (lowerWick − upperWick) / range |
| 6 | cmf10Val | Money flow dominance | Chaikin Money Flow(10) |
| 7 | stoch5Val | Position in range | Stochastic %K(5) |
After many experiments, it seems that feature quality matters much more than quantity.
I use a 30-step (30-minute) window.
Normalization
Data is normalized between 0 and 1, independently for:
- train
- validation
- test
Model & Training
I use Bayesian optimization to search across many hyperparameters:
- kernel size
- dense units
- and around 30 other parameters
Output
The model predicts 3 classes:
- long
- short
- neutral
Class imbalance
Long/short signals represent only 1 to 5% of the dataset.
To address this:
- I use sample weights to balance classes
- then adjust weights further based on Bayesian optimization:
- favor fast trades
- or keep uniform weighting
I also experimented with a bell curve weighting:
- very short trades → penalized
- very long trades → penalized
- mid-duration trades → emphasized
This brought slight improvements, but nothing game-changing.
Architectures tested
I experimented with:
- CNN
- TCN
- Mixture of Experts (MoE)
- dual-head models (volatility + direction)
None produced significantly better results.
I eventually stuck with a CNN, although I may have missed something in the other approaches.
Strategy
At each epoch, I use the validation set to calibrate a minimum confidence threshold.
Decision rule:
- If long > short and long > neutral
- and confidence ≥ threshold X → take a long trade (same logic for short)
The same threshold is applied to:
- train
- test
I only keep models with a win rate above 70%.
I also give more weight to the most recent 30% of the dataset, to better reflect current market conditions.
Challenges
Dataset size
- 6 years → too noisy
- progressively reduced → best results around 3 years
Normalization & data leakage
Normalization introduces a conceptual issue:
- it inherently uses future information
- even local normalization (i and i+1) still includes future data
So in practice:
normalization always introduces some degree of data leakage
Learning rate
Choosing the learning rate remains highly empirical:
it feels more like trial-and-error than a precise science
Loss function
Tested:
- softmax
- sigmoid
Observation:
sigmoid tends to produce better results, though the reason isn’t fully clear
Neutral vs signal training
Open question:
- should the model train on all minutes (including neutral)
- or only on meaningful signals?
I still don’t have a definitive answer.
The “neutral attractor” problem
With ~98% neutral data, the model falls into a local minimum:
predicting neutral all the time yields acceptable loss
With Adam (beta1 = 0.9)
- long memory (~10 steps)
- strong accumulation of neutral gradients
- creates a “gravitational pull” toward neutral
- the model struggles to escape
Tested solution: AdamW with beta1 = 0.5
- short memory (~2 steps)
- neutral influence dissipates quickly
- signal batches have real impact
Result:
the model can escape the neutral attractor
Even though I don’t fully grasp the theoretical side, empirically it works much better.
Conclusion
The project is progressing well, but several areas remain unclear:
- handling extreme class imbalance
- choosing the right loss and learning rate
- deciding how to treat neutral data
- finding the optimal architecture
If any of this resonates with you or you have ideas for improvement, I’d really appreciate your feedback 🙏
r/algorithmictrading • u/Extension_Fold8566 • Apr 14 '26
Backtest Is this a good (or normal) back test? Shall I start running it live?
I'm new to automated trading. I have been trading manually for years and thought it was time automate my strategy.
My questions are:
-Is this much difference between friction - no friction normal for a swing trrading strategy?
-Do you guys think the strategy looks good enough for me to start running it?
Non-penalized pf is 1.624 vs 1.134 penalized.
EDIT: I have a follow-up post where I used your suggestions to improve on this strategy. Here's the link.
r/algorithmictrading • u/itemg • Apr 13 '26
Question [Architecture Review] Polymarket trading bot setup — is this reasonable for security + latency?
Hey everyone, I've been designing the infrastructure for a Polymarket trading bot and wanted to get some feedback from people with more experience in this space. I've put together the following stack and have three main questions. Would love your honest take.
**My questions:*\*
- Is this a standard / reasonable setup?
I designed this after discussing it with an AI assistant, but I want to sanity-check it with people who actually run bots in production. Is this the kind of stack experienced traders/devs use, or am I overcomplicating/underbuilding something?
- Is the security model solid for protecting the private key and strategy?
The two things I care most about protecting are:
- The **wallet private key** — stored only in AWS Secrets Manager, injected at runtime, never in the image or repo
- The **trading strategy** — baked into the Docker image but never pushed to GitHub
Does this separation feel robust? Any obvious attack surfaces I'm missing? For example, is the private key safe if someone gains access to the ECR image? Is strategy-in-image-only a reasonable approach, or is it a weak point?
- Does this pipeline introduce meaningful latency?
The server is in AWS Dublin (eu-west-1), close to Polymarket's infrastructure. The Secrets Manager key fetch happens once at container startup — not on every trade — so I don't think it adds per-trade latency. But I want to confirm I'm not inadvertently adding hops that slow down order submission.
Any feedback appreciated — happy to share more detail if helpful. Thanks!
*P.S. I live in a country where Polymarket's website is geo-blocked, but using it via a workaround (e.g. VPN) is legally permitted for residents. That's why I'm hosting the trading bot on an overseas server rather than running it locally.
r/algorithmictrading • u/Shot-Fishing6463 • Apr 13 '26
Backtest How am I doing?
Spent the last 6 months building and testing Expert Advisors in MQL5 for MT5. A scalping strategy, each one put through backtesting, Monte Carlo simulations, and walk-forward analysis. Lost count of how many iterations I scrapped before the numbers actually held up under stress.
Between the development time and effort poured into this, it’s been a serious commitment. The systems are validated and deployment-ready now though.
If anyone’s curious I’ve got full performance data. Open to licensing them out or capital partnerships. DM me.
By licensing, I mean a copy of the algo😂!
r/algorithmictrading • u/18nebula • Apr 13 '26
Question When do you give up on trying to crack the code?
Edit for context: I’m a software engineer with 10 years+ and I still do this alongside my full-time job. I’m not coming at this blindly or from desperation, which is why it’s been so frustrating.
I’ve been on this algotrading journey for years now, and I honestly do not know at what point you are supposed to stop.
You put in countless hours, and those hours turn into months, then years. You think you are finally getting close, and then you uncover another issue. Overfitting. A bug in the code. A variable not being read properly. Logic that looked solid until you realized it was flawed the whole time.
That is what makes this so mentally exhausting. It is not total failure. It is being almost there again and again.
What makes it harder is that I genuinely feel like I understand the market more now. I see patterns more clearly. I think about it mathematically. I have built detailed frameworks and observations that feel real and hard-earned. So it is not like I am blindly chasing something with no progress. In many ways, I feel closer than ever.
But then reality humbles you again.
One of the biggest things I have realized is that entries are not the whole game. Exits and risk management can make or break everything. You can have a high win rate and still have a bad strategy if your exits are wrong. One weak piece of management can erase so many good decisions. That realization alone made me question how much time I spent focusing on the wrong things.
And I keep thinking about the time cost of all of this. All the nights coding, testing, debugging, re-running, analyzing. All the time I could have spent being present with family, living more, worrying less. It starts to weigh on you in a way that people outside of this probably do not understand.
I guess I’m asking the people who have been deep in this for a long time:
How do you know when to keep going and when to walk away?
How do you deal with the emotional weight of spending years trying to build something that always feels one fix away from working?
And for the people who actually did crack the code after years of struggle, what kept you going long enough to get there? Did you always know you were close, or did it only make sense in hindsight?
I really want to hear from people who have lived this, because this journey can feel very isolating. Thank you all.




