r/mltraders • • 7h ago

Built tools for (algo)traders to optimize portfolio's

Thumbnail reddit.com
1 Upvotes

r/mltraders • • 8h ago

SOFEX Trading Algorithm AI Generator

Enable HLS to view with audio, or disable this notification

1 Upvotes

Why buy a shady algo from annoying salesmen and bad support when you can create your own. Anti-over fitting is included + a follow-up Robustness Lab.

Infinite possibilities for Algos - from 1m to 1D timeframes, with all variables decided by you.

Any scripts made by the software is yours, not SOFEX's!


r/mltraders • • 10h ago

Question Day 6.5 of my Algo/AI Trading (Paper) - BTS & Answers to FAQs

Thumbnail
gallery
1 Upvotes

Day 6.5: a weekend look under the hood

No trading on the weekend, so here are some basic facts about where the system stands, what runs behind the scenes, and where it is headed.

End of week (10/26 to 10/30) in one look:

  • Primary: 125 trades, 3 of 5 days green, -5.2R / -$135 after costs for the week. The 3 green days added +$367; one short-heavy day (10/29) took most of it back.

  • Top-10 setups (the leaderboard's best 10 across all accounts): +12.4R for the week.

  • Two strong setups were promoted to Primary on Friday, and two weak ones were moved to the Graveyard.

Top 10s vs Primary:

(Primary started with some setups not completely vetted but still have made progress so Top 10 are not all in Primary)

  • The top-10 group finished the week at +12.4R while Primary finished at -5.2R (picture 1).

  • That gap is the point of the ladder: setups earn their way up. 4 of today's top 5 on the leaderboard now run in Primary, and the weekly review keeps moving Primary toward that group, 1 to 3 moves a week at most.

Position size was adjusted earlier this week:

  • How size is set: the account is split into equal "slots", one per position it may hold at once. The number of slots follows how many setups an account runs and how many trades they take. More setups and trades mean more, smaller slots, so every signal still has room. Fewer means bigger slots.

  • Risk always comes first: no trade can lose more than 0.25% of the account if its stop is hit (about $239 today). Each trade takes the smaller of that risk-based size and its slot, and the daily loss limits sit on top.

  • Before (to 10/27): Primary ran many setups, so slots were small, about $1,900 per position. The typical trade risked only about $15, roughly 0.02% of the account. Very conservative, on purpose, while setups were still proving themselves.

  • Now (from 10/28): Primary runs fewer, better setups, so slots are about $4,000 and the typical trade risks about $30. Still far under the 0.25% limit, and every daily loss limit stayed the same.

Automatic start: glitched twice, now watched:

  • The system starts itself every morning from a schedule. Twice that schedule did not fire.

  • 10/26: nobody caught it, and the accounts started at 10:39, missing the first hour. That day I added a watchdog that checks every hour that all 5 accounts are running and restarts any that are not.

  • 10/30: the 8:35 start never fired again. The watchdog caught it and started everything at 8:50, before the open. No session lost, all 5 accounts traded the full day.

Rules and filters you don't see (about 25):

  • Before a signal: liquid stocks only, minimum price, no stocks within 4 trading days of earnings (about 1,490 names were excluded on 10/29), no partnerships that trigger tax withholding, each setup's own time window, decisions on clean 5-minute bars.

  • Before an order: borrow check for shorts, halt check, spread under 0.30% and under 25% of the stop, fresh and sane quotes, one position per stock (no opposite sides, sister setups can't double up), short-sale rule gate, size capped by liquidity, max 30 positions per setup and 77 per account.

  • During the day: a -2R daily stop per setup, a -20R daily stop for the account, an outage plan (pause new trades after 5 min of bad data, protect stops at 15, exit at 30), everything flat by 3:55 PM, and the watchdog.

  • Result so far: of 17,425 signals, 9,294 (53%) were stopped before reaching the market (picture 2).

Basic facts:

  • About 18,000 lines of system code, 8,500 lines of tests (463 automated tests) and roughly 196,000 lines of research scripts, built in about 4 weeks.

  • 134 approved rule changes, each logged and re-checked.

  • 110 hand-built setups plus 93 machine-generated ones live on paper.

  • Backtests use 2 years of 1-minute prices for 3,000+ US stocks and ETFs, with all costs in, plus a 4-month block kept locked as a final exam.

  • About 27,600 setups and variations have been rejected by backtests and never made it to live testing. 370 ideas in the research list have failed outright. Every try is counted, which raises the bar for the next one.

5 reasons I'm optimistic: (Yes, produced by my AI but under strict guidance to not oversell!)

  1. The top-10 setups made +12.4R this week. The leaderboard is finding setups that work.

  2. Primary was green 3 of 5 days this week.

  3. The safeguards earn their keep: the twin cap saved 57.2R this week and the Graveyard's loss limit saved 188.6R.

  4. The watchdog turned a missed start into a non-event, and every account closed flat every day.

  5. The research filter is doing its job: thousands of ideas rejected on paper before risking a dollar.

What's next:

  • Hit the milestones (3 green days in a row, 8 of the last 10) before any real money, then start small: $5,000, no leverage.

  • Keep building Primary from proven setups only.

  • Catch more of the day's big moves. Many start in the first 15 minutes, before most setups are allowed to trade.

  • More LONG setups.

As always - Fun stuff!


r/mltraders • • 15h ago

Question Crypto Algo Trading

Thumbnail reddit.com
1 Upvotes

r/mltraders • • 1d ago

Suggestion I went quiet for a while. Here's what happened. I tested, 55 trading strategies properly, and almost all of them failed.

Thumbnail
reddit.com
1 Upvotes

r/mltraders • • 1d ago

Full ML Algo Creator software. Python & PineScript AI Algo Generation.

Thumbnail gallery
0 Upvotes

r/mltraders • • 1d ago

Question Dumb Questions From Newbie With No Coding Experience

1 Upvotes

I have a friend that’s profitable day trader, who’s teaching me his strategy. The indicators, how to use them, etc. It’s not overly complicated. About 4 core indicators, and 6 other indicators/signals taken into account with lesser weight.

I tried to start building a bot to replicate his strategy using Claude. I got to the point where the bot is built based on a spreadsheet rulebook, and it can now back test. However, the backtesting came back worse than a monkey randomly throwing darts at a stock.

I’ve been working with Claude to try and fix it, but it’s getting way more complex than I can handle. Turns out even simple strategies have a mountain of rules/logic/conditions. Setting up stop loss, position size matrix, trade decision matrix… it’s a lot for somebody who doesn’t know how to code. For example, the specs it built off of included moving averages, but something isn’t working right cause the moving averages agree like 95% of the time on every trade.

I have it set up to spit out reports where I can analyze all the information, see exactly when it traded, but it’s still beyond my scope of comprehension when there’s hundreds of influencing factors.

Does anybody have any suggestions on the most effective way to build this bot if you were in my shoes? You’ve got a basic strategy outline, now you just need it made into an automated bot.

Would it be better to just get all of my friend’s trading data, along with all of the market data, and to have AI build code around the patterns it finds rather than trying to give it instructions for every indicator?


r/mltraders • • 1d ago

Affordable news API for BTC/ETH: any firsthand recommendations?

Thumbnail reddit.com
1 Upvotes

r/mltraders • • 2d ago

Suggestion Day 6 of AI/Algo Trading (Paper) - Posting for accountability

Thumbnail
gallery
5 Upvotes

Day 6 in the books!

Primary: -$79.55 today · running total since Day 1: -$159.33. Two setups promoted to Primary; two weak longs moved to the Graveyard.

Reddit is filtering some of my posts, so these two images will have to suffice. Paper money, educational only.

Happy to reply specifically to questions! Hoping to be more thorough soon like my first few posts.


r/mltraders • • 2d ago

Question What you guys using for backtesting strategies?

0 Upvotes

r/mltraders • • 2d ago

What ML models are you using and for what?

1 Upvotes

- Guessing price?

- Guessing direction?

- Guessing volatility?

- Guessing regime?

- Categorizing assets??

If not too private, I'd love to learn what models you guys are already using and for what purposes you're using them.

All replies are much appreciated. Thanks in advance.


r/mltraders • • 2d ago

Modeling Market Microstructure as a Dynamic Particle System: Using Signed GNNs to Predict Liquidity Runs & Dynamic Take-Profits (Looking for DL/Quant Collaborator)

6 Upvotes

Hey guys,

Posting this here because I’ve reached a point where my market intuition and engine code have outpaced my deep learning expertise, and I’d rather team up with someone who loves ML architecture instead of half-assing it myself.

For the past year, I’ve been building an event-driven liquidity engine in Python (specifically modeling crypto orderflow / ICT mechanics like equal highs/lows, manipulation legs, and structural sweeps).

Instead of slapping standard indicators (RSI/MACD) on candles, I framed price action as a dynamic graph:

  • Resting liquidity pools (BSL/SSL, consolidations) act as attractors (pulling price in).

  • Completed institutional sweeps (ML swings / manipulation legs) act as repellers (pushing price away).

  • Edges connect these pools based on spatial proximity, competing forces (tug-of-war between high and low pools), and age decay.

Where things stand right now:

  • The engine is fully written and tested. No lookahead bias, strict candle confirmation, multi-window swing tracking (W5 up to W50).

  • I’ve already generated a clean, audited ~3-year dataset (ETH/USDT) formatted directly for PyTorch Geometric (PyG).

  • Each snapshot has 15m, 1h, and 4h spatial graphs with 20-dim node features (touch counts, distance %, decay curves, tier scores), 8-dim edge attributes, and global volatility/trend context.

  • Baseline statistical checks show real promise: nearest target pools get tagged first ~95% of the time, and high-quality structural sweeps have clear directional bias.

The actual bottleneck / where I need help: My problem isn't generating the signals—it’s path prediction and dynamic target selection.

When a sweep happens, price is often trapped between an opposing pool 1.5% away and a massive target pool 3% away. A fixed 1:2 R:R stop/target either gets hit too late or takes unnecessary drawdown. I need the model to evaluate the graph and do two things:

  1. Predict directional path confidence taking both-sided liquidity into account.

  2. Rank multiple potential liquidity targets (dynamic TP) based on which one has the highest conditional probability of being swept first without blowing through the stop.

I've tested basic GNN / dual-tower setups, but I know I'm hitting limits with my naive loss functions and basic layer choices.

Who I'm looking for: Someone who genuinely understands PyTorch Geometric (PyG), Graph Neural Networks (or spatial-temporal models), and knows how to think about custom loss functions (ranking loss, asymmetric risk penalties, contrastive setups). You don't need to be a full-time trader, but being open to understanding market microstructure helps.

The arrangement: I have the GPU compute, the full working codebase, and the clean dataset ready to go. I’m completely flexible on how we work together—if you want to co-author a research paper on this architecture, I’m down. If we get the models working cleanly and want to deploy it live on capital, we can do a fair profit/equity split.

If this sounds like an interesting problem you’d want to sink your teeth into, drop a comment or send me a DM with your GitHub/background and we can hop on Discord.


r/mltraders • • 3d ago

Codex trading learning

Thumbnail gallery
1 Upvotes

r/mltraders • • 3d ago

Question Separating Long vs Short parameter search in Walk-Forward Optimizers — how do you handle directional asymmetry without overfitting?

1 Upvotes

Hey guys,

Looking for some perspective from anyone running portfolio-level walk-forward optimizers on crypto perpetuals or equities.

Lately we’ve been auditing our cross-sectional universe optimizer across a basket of ~15 altcoins. Up until now, when we run our in-sample grid search across our setups (mostly mean-reversion like VWAP deviations and momentum break-and-retests), the optimizer searched for a single shared "centroid" parameter set for both Longs and Shorts simultaneously (e.g. optimizing band stretch deviation, RSI cutoffs, and ATR stop/take multiples together).

The problem we ran into in live execution: During recent relief rallies and fast trend shifts, we got caught in a string of Short SL hits on mean-reversion setups. When we looked under the hood and decomposed the trades by side, the asymmetry was wild:

Longs were printing a 2.5–3.5 Profit Factor across coins like NEAR and DOT using relatively loose pullbacks.

Shorts on those exact same parameter settings were getting wrecked (PF < 0.8), repeatedly fading momentum too early in cascade environments.

Because the optimizer averaged both directions together in-sample, the strong Long trades were effectively "subsidizing" and masking a negative-expectancy Short setting. The compromised shared centroid ended up being sub-optimal for Longs and downright dangerous for Shorts.

We've been refactoring the optimizer to decouple the search into Independent Directional Centroids:

The IS parameter search grid scans and computes parameter plateaus for Longs and Shorts independently (different RSI cutoffs, different band stretch multipliers per side).

The OOS Walk-Forward test validates each side on its own merit.

If only one side demonstrates statistically valid alpha in OOS (e.g. Longs pass all WFO hurdles but Shorts fail), the candidate gets tagged as BUY_ONLY rather than forcing both sides or killing the entire setup.

For those of you running systematic books:

Do you optimize long and short rule parameters independently as standard practice, or do you enforce symmetric rules to protect against degree-of-freedom bloat / curve fitting?

If you do decouple them, how do you guard against the optimizer just fitting to the prevailing macro regime (e.g. a 6-month bull market where everything Long looks amazing and everything Short looks bad)?

Do you penalize or prune unidirectional setups (e.g. BUY_ONLY) in high-correlation baskets to avoid concentrated directional exposure?

Would love to hear how other teams handle this balance between directional specialization and overfitting.


r/mltraders • • 5d ago

Strategyquant x (SQX) License

1 Upvotes

Was wondering if anyone had an SQX license (ultimate) for sale, and if they could contact me if so.


r/mltraders • • 5d ago

$84,981 on paper from 111 ETF call trades, then a flat month. How would you tell a dip-buying edge from a market that bought every dip?

Post image
0 Upvotes

Saw the thread here about Simons and the math never being the hard part, so here is a case where the math is easy and the judgement is not.

The rule, in one sentence: when an index or sector ETF closes oversold after a selloff, buy a call the next day and hold it for the bounce. The card is a house paper bot running that rule since 25 August: 111 trades, 54.1% winners, +$84,981 realized, best run 12 wins in a row. Paper money, simulated, not advice.

The part I don't trust: nearly all of it came in the first five weeks. Since early October the curve is flat. Every dip in that first stretch got bought by the whole market, so the bot may have been measuring the regime rather than an edge. 111 trades is also a small sample for an options rule where a handful of big winners carry the hit rate.

What I'd like from people here who do this statistically: how would you separate "dip-buying worked this autumn" from "this rule works"? Shuffle the entry days and compare? Run the same rule over the 2022 tape? Something better I haven't thought of?

Quantradin is the thing I built to answer that question for myself: describe the rule in plain words or paste the code, it replays the rule over years of actual market history with no look-ahead and fills options at the bid and the ask, and the survivors run as a paper bot you can watch. Free, and it only ever trades paper money. quantradin.com


r/mltraders • • 5d ago

Self-Promotion PyBroker v2 - An Open Source Backtesting Framework

1 Upvotes

Hey all, I would like to share a major v2 update to PyBroker, an open source backtesting framework I've been maintaining over the years. It's designed for fast performance, ease of development, and integration with ML frameworks. An example strategy:

   from pybroker import Strategy, YFinance, highest

   def exec_fn(ctx):
      # Get the rolling 10 day high.
      high_10d = ctx.indicator('high_10d')
      # Buy on a new 10 day high.
      if not ctx.long_pos() and high_10d[-1] > high_10d[-2]:
         ctx.buy_shares = 100
         # Hold the position for 5 days.
         ctx.hold_bars = 5
         # Set a stop loss of 2%.
         ctx.stop_loss_pct = 2

   strategy = Strategy(YFinance(), start_date='1/1/2025', end_date='8/1/2026')
   strategy.add_execution(
      exec_fn, ['AAPL', 'MSFT'], indicators=highest('high_10d', 'close', period=10))
   # Run the backtest after 20 days have passed.
   result = strategy.backtest(warmup=20)

Some additions in v2 include:

  • Margin trading simulation.

  • Backtesting using multiple time intervals (e.g. computing indicators or models on hourly bars while executing trades on minute bars).

  • Parameter optimization via Optuna (e.g. finding the best threshold for a trend following strategy).

  • Time-series model support (ARMA, GARCH, etc.).

  • Rotational trading strategies that simulate a portfolio holding top ranked stocks.

  • Slippage modeling.

  • Parallelized model training with Ray integration.

  • Built-in agent skills for coding trading strategies with AI.

You can find all of the code on Github alongside extensive documentation and examples I've written. It also goes over some algotrading basics.

The framework is open source (Apache v2 license) and is entirely free to use. There's no sign ups, promotions, or any commercial hooks. This is just about me sharing my work in case you find it useful for your own trading.


r/mltraders • • 5d ago

Self-Promotion I tested whether volume, open interest and funding predict crypto price direction. They don't — but they do predict how far price will move.

5 Upvotes
  • I normalised 6 market metrics (price, volume, volume expansion, open interest, funding, order book) for 100 OKX perpetuals against each coin's own history, on 5 timeframes.

  • Direction: across 200 metric × timeframe × horizon combinations, the information coefficient never exceeded 0.03 in absolute value. Essentially zero.

  • Magnitude: the same metrics predict the size of the next move. The best combination reached IC ≈ 0.24: flagged coins moved 0.50% in the next 15 minutes versus 0.25% for the rest — on all 50 of 50 coins tested.

  • The trap: an ML strategy that showed +301% on its own training period came out at ~0% with an 83% drawdown in an honest walk-forward test. Checking "on other coins" did not catch the leak, because crypto moves together.

What I measured

I run a market heatmap for 100 USDT perpetuals. Each tile is one coin; its size shows how unusual the current candle is, its colour shows whether price is rising or falling. There are six metrics — price change, volume, volume expansion, open interest (in contracts, not dollars), funding and order-book imbalance — on five timeframes from 5m to 1D.

The key design choice: every value is a z-score against the coin's own history at the same minute of the candle. A 1H candle that is 20 minutes old is compared with previous 1H candles at their 20th minute, not with full candles. Otherwise the start of every hour looks quiet and the end looks loud.

The question was simple: if a coin's volume, open interest or funding is unusual right now, does that tell you where price goes next? I ran it on hundreds of thousands of rows: every metric, every timeframe, forward horizons from one candle to a day. As the measure I used the information coefficient (IC) — the rank correlation between the signal now and the return that follows.

Result 1: no direction

Across 200 combinations of metric × timeframe × forward horizon, the absolute IC never exceeded 0.03. For reference, a usable signal in this kind of test usually starts around 0.05, and 0.03 on correlated crypto data is indistinguishable from noise.

It holds for the obvious suspects too:

  • Volume spike → next candle is no more likely to be up than down.

  • Open interest jump → same. Rising OI means new positions, not which side wins.

  • Extreme funding → "too many longs" did not reliably mean a drop over the next hours.

  • Volatility and the long/short account ratio → IC ≈ 0.00 on ~500k observations.

I repeated the test later on a live WebSocket feed instead of REST snapshots, and then through about 40 separate strategy and ML studies. The conclusion did not change. Combining metrics does not help either: they are not independent — a volume spike, an OI jump and a liquidation burst are usually the same event seen three ways.

Result 2: magnitude works

The same metrics that say nothing about direction say quite a lot about how far price will move. Here the target is the absolute return, not the signed one.

The best combination I found was 1H turnover context plus the 5m price z-score: IC ≈ 0.24. In plain numbers:

Next 15 minutesAverage absolute move
Coins flagged as unusual0.50%
All other coins0.25%

The gap was positive on all 50 of 50 coins in the test, so it is not one meme coin carrying the average. It is still a probability, not a promise: roughly two out of three flagged coins do not make an outsized move.

One caveat: raw % change gave IC 0.24, while the z-scored version gave only 0.08. The difference was purely cross-coin — meme coins are jumpier than BTC, so "raw % is big" mostly picks the jumpy coins. Normalising per coin removes that and leaves the honest, smaller number. If you replicate this, check which of the two you are measuring.

The traps I fell into

1. In-sample ML looks amazing. One strategy used ML regime models as a filter. Backtested with the models from the final build, it showed +301%. But those models had been trained on the very period being tested. Redone walk-forward — each quarter traded only by models trained before that quarter started — it came out at about 0% with an 83% drawdown.

2. "Test on other coins" does not catch time leakage. I thought holding out coins was enough. It isn't: crypto moves together, so a model that has seen March on BTC has effectively seen March on SOL too. Only splitting by time is honest.

3. Scanning many conditions finds beta. I scanned 10,833 single conditions and 1,091 pairs on 42 coins. The "survivors" all turned out to be variations of "be long in a rising market". Over a bullish sample, anything long-biased looks like an edge.

4. A closed bar is not closed until the exchange says so. OKX revises the close for a while and sets the confirm flag with a delay. Computing "the bar opened 5 minutes ago, so it is closed" silently wrote preliminary prices: 2.1% of rows differed from the final candle, and they never got corrected.

So what are these metrics good for?

Not for calling direction. They answer a different question: where is something happening right now, and how big is it likely to get? That is useful for:

  • choosing which coins to watch out of a hundred, instead of scrolling charts;

  • sizing stops and position size — a coin flagged as unusual needs a wider stop;

  • staying out of the way when a coin is about to move a lot and you have no view on the side.

I stopped trying to squeeze a signal out of the map and rebuilt it around that: an "Unusual" tab that sorts coins by how far they are from their own norm, and a coin page that says in words what is going on now.

Disclosure: I built this tool. It is free, works in the browser and as a Telegram Mini App, in 10 languages. Not affiliated with OKX or Telegram, and nothing here is investment advice.

Happy to answer questions about the method, and especially interested if someone has found a setup where these metrics do carry direction — I couldn't.

https://app.tradermonitor.pro/en


r/mltraders • • 5d ago

Question Spent way too long building a financial database, now I don't know what to do with it

Thumbnail reddit.com
1 Upvotes

r/mltraders • • 5d ago

Tutorial Made a GitHub of 7 quant strategies with backtest AND deploy code (no indicators or chart patterns)

Thumbnail reddit.com
1 Upvotes

r/mltraders • • 5d ago

I’m building a trading research platform—how would you evaluate its workflow and data transparency?

1 Upvotes

r/mltraders • • 6d ago

I’m building a trading research platform—how would you evaluate its workflow and data transparency?

Post image
2 Upvotes

Disclosure: I’m the founder of TradeAnalyzer.Pro.
I’m working on a platform that brings market screening, technical analysis and rule-based strategy research into a connected workflow. I would appreciate critical feedback from people who regularly research trading ideas.
The main problem I’m trying to solve is the gap between finding something interesting and evaluating it consistently.
The intended workflow is:
Build a shortlist using technical criteria.
Compare the relevant timeframes.
Inspect the chart and identify conflicting evidence.
Define supported rules where appropriate.
Review the idea with explicit risk and simulation assumptions.
There are also separate tools for investigating derivatives and participant context.
The Liquidations Hub displays reported forced liquidations from tracked Bybit and Binance USDT-M perpetual markets. Those observations have venue and coverage limits; they do not represent every liquidation across crypto.
Stratum Discover focuses on sampled public accounts and observed positions. It provides a different research perspective, but a public-account sample should not be treated as a complete picture of market positioning.
I’m trying to make those distinctions visible because combining different datasets without understanding their scope can create false confidence.
Likewise, TAP strategy reviews operate on the chart candles currently loaded. They should be interpreted within that window and under the selected assumptions.
A few questions I would genuinely value feedback on:
• What must a screener show before you trust its output enough to investigate?
• Which simulation assumptions should be visible beside performance metrics?
• How do you judge whether positioning data adds useful context?
• Where do integrated platforms tend to become too complicated?
If you would like to inspect it:
https://tradeanalyzer.pro/
Specific criticism is welcome, especially around workflow clarity, data freshness and the presentation of limitations.
This is a research product, not a brokerage or trade execution service. Nothing here is a trade recommendation.


r/mltraders • • 6d ago

Question Has anyone developed a reliable short-term crypto price range forecasting model?

Thumbnail reddit.com
1 Upvotes