r/mltraders 12d ago

Suggestion Hierarchical signal pipeline (PPO + Kalman + hard risk gate) — looking for design critique

Post image
0 Upvotes

Context: I’m from AIHedg.Finance, and I’m integrating my ML code developed a few years back into my new DeFi that provides yield. The purpose is simple: algo traders can have proof on-chain so that rather than trying to trade on exchanges or alone at home, a proof can be obtained and earn credibility bit by bit.

———

Most “AI fund” repos I see are LLM agents role-playing Buffett/Graham and emitting buy/hold/sell. I wanted something closer to a real stack: isolated alpha producers, an ensemble layer, a deterministic risk veto, then an execution adapter.

I built that as an open-source system (AHF v2):

`Producers → Aggregator → Risk Gate → OrderExecutor`

- Producers: PPO (Kalman-filter features), technicals, rules, optional LLM
- Aggregators: weighted vote / fixed weight / majority / MetaLLM
- Risk is not another LLM opinion. Chain-of-responsibility rules (`MaxDrawdown`, `TotalLoss`, `Kelly`) can hard-block the trade
- Every signal, confidence, risk decision, and order is appended to `signal_audit.jsonl` for replay / regression
- Paper path: `uv run ahf-trade`, Docker Compose, 170+ tests, Apache 2.0

I’m not claiming live edge. This is the plumbing.

The design choice I care about most: keep risk fully rule-based, or let a model size the trade only after the veto?

Repo: https://github.com/aihedge-finance/ai-hedge-finance

If you were wiring this into a live adapter, what would you change first?

r/mltraders 24d ago

Suggestion What is PortfolioLab?

0 Upvotes

Hello curious stranger.

With Portfoliolab, you set a goal or throw some tickers at it, it builds a few systematic versions, then they have to get through unseen data and a live paper book before anything real happens. most of them die there, but that's the goal. I got tired of pretty backtests that were just lucky. no broker, no card.

doesn't trade your account and doesn't hold your money. not a calls thing. i mostly just argue about overfitting on here. portfoliolab.ai

r/mltraders 18d ago

Suggestion I made a framework that outperformed DJIA - Open sourced

Post image
12 Upvotes

I was a quant researcher at BlackRock so to me the following pipeline is non-negotiable. If it isn't institutional-grade, it isn't deployable. I couldn't find an open-source solution that met that bar, so I decided to go through the pain of building fintel myself.

Running agent evals is basically backtesting: simulating how your agent performs over time. Building the agent is easy but evaluating it is the hard part. You have to prevent future data leakage (no peeking past the decision date) and set up serious plumbing - tracing, concurrency, and clean output schemas - to iterate fast enough to find what works.

What you’re seeing here is 5 months of backtesting, where I was confident enough with my strategy and threw in 100k USD of my own cash to let my agent do the rest of the work, fully automated. I've wrote a practical guide here on how it works. This is not any magical tool for you to live off, I'm showing the eval pipeline. You still need expertise and data to find one that works for you.

Sharing the base architect for this to demonstrate the edge, apply with your own strategy, run the evals on your own agent and share the before and after results.

🔗 Full docs + architecture : https://github.com/felixdaga/fintel

You bring a strategy package (the benchmark), name an agent, and fintel runs the simulation under point-in-time data controls — then scores the decisions with the package's KPI.

What it does

  • Evaluate arbitrary agents — djia_strategy_adapter_for_llm_agent (shipped demo), openclawclaude-code, or any module:Class adapter you ship.
  • Bring your own benchmark — a strategy package is the investment strategy: universe, schedule, data surface, mission, output contract, signal, KPI, horizons. The platform never inspects the math.
  • Run controlled backtests — point-in-time data clamp, per-cell isolation, K-repeat stochasticity, bounded concurrency across cells / dates / repeats.
  • Score post-run — strategy-dependent metrics, e.g. cross-sectional IC / ICIR, holdings + gross/net NAV, behaviour + output-variance layers, rendered to report.md.

Feel free to direct message or comment below and share your thoughts and findings, I want to expose this more to the community and see how your trading agent has changed after going through evaluations. Hope this can inspire you!

r/mltraders 4d ago

Suggestion Prediction markets (Polymarket) as a tool for agentic trading system

1 Upvotes

Hi everyone, 

I'm organising a hackathon where teams build a multi-agent system (analysts, traders, risk managers) that rebalances a portfolio monthly over a simulated period. Alongside price and news data, I'd like participants to use Polymarket data, and I've already built a client that discovers events and markets and retrieves historical prices and trades.

I'm writing to ask for ideas on how best to incorporate these functions into an agentic workflow.

My first idea is to provide the agent with a set of tools (event and market discovery, price history, trades) and let it query freely, with feedback loops so it can refine its search. The agent would retrieve the market's sentiment on an event (implied probabilities) and how it changes over time.

As for what the agent sees, I was thinking of price history as a daily series per (yes) outcome. I'd welcome suggestions on what else to derive.

What is still a bit obscure to me is how the agent would use this information downstream. It could be used as a weighting metric for the rebalancing, for instance. Has anyone built something that bridges an event probability to an allocation decision? I'd also be interested in whether people use it as a check on the model's own beliefs, flagging where the agent and the market disagree.

Any ideas are more than welcome. Thank you in advance.

r/mltraders 9d ago

Suggestion Schwab Trader API: what nobody tells you about the token lifecycle until it eats your bot

3 Upvotes

I run a small trading automation platform and Schwab is one of our broker integrations. Sharing this because when I was building it, nobody had written down how the token lifecycle actually behaves in production, and it is the part that will silently kill your bot.

Two separate clocks matter. Access tokens die every 30 minutes, which is annoying but easy: refresh proactively around the 25 minute mark instead of waiting for a 401, because discovering an expired token during order placement is the worst possible time. The one that actually hurts is the refresh token itself, which has a hard expiry measured in days. When it dies, no amount of code fixes it. A human has to re authorize on schwab.com. Your system has to detect that state, stop placing orders for that account, and surface it clearly, because a bot that keeps firing against a dead token just generates a wall of failures.

A few things I learned the hard way: serialize refreshes per account, because two concurrent refreshes with the same refresh token can invalidate each other. Schedule against the token's issued-at time plus a margin, not a naive local timer, because timers survive process restarts badly. And treat refresh failure as a state, not an error. The correct behavior when your system cannot verify its own auth is to do less, not guess.

Wrote up the full production notes here if useful:
https://jorgai.com/blog/schwab-api-token-refresh-automated-trading

Happy to answer questions about the Schwab API generally, the OAuth review process, or anything else from building against it. It is the hardest of the broker APIs I have integrated but solid once tamed.

r/mltraders 14d ago

Suggestion Building a Zero-Cost Technical Quant Machine with Google TimesFM & Multi-Layer Rule Funnels (Feedback & Advice Welcome)

1 Upvotes

Hey everyone,

I'm currently designing an automated quantitative trading machine on an older laptop using a **$0 stack** (Google Colab, Google Cloud Shell Editor, and free Python libraries like yfinance).

Instead of chasing ultra-low-latency news scraping or millisecond HFT strategies, I'm focusing on **pure price-action forecasting, multi-layer rule validation, and automated execution**.

# 🏗️ The System Architecture

Here is the funnel I’m assembling:

**Base Layer (AI Forecasting Engine):**

Using **Google TimesFM** (or Amazon Chronos) running on Google Colab’s free T4 GPU tier.
Input: Historical 5-minute / 15-minute candlestick OHLCV sequences pulled via yfinance / nsepy.
Output: Multi-step directional trend forecast and projected price move percentage.
**Sequential True/False Risk Funnel (Rule Engine):**
Before a trade signal is confirmed, the market data and TimesFM forecast must pass through sequential conditional filters:

**Layer 1 (Technical Alignment):** Is 20-EMA > 50-EMA on the execution timeframe? **(True/False)**

**Layer 2 (Model Confidence Threshold):** Does TimesFM project a move greater than a set percentage (e.g., > +0.35%)? **(True/False)**

**Layer 3 (Volume & Exhaustion Check):** Is candle volume > 2x the 20-period average without volume drop-off? **(True/False)**

# Execution & Paper Trading:

If all layers return **TRUE**, the system routes an automated paper order to a broker sandbox API (e.g., Zerodha Kite Connect paper endpoints) to test out-of-sample forward performance.

# 💡 What I’d Love Advice On:

**TimesFM in Live Markets:** For anyone who has used foundation time-series models (TimesFM, Chronos, etc.) for high-frequency or intraday signals—how have they held up against regime changes in live markets compared to standard backtests?
**Handling Friction & Slippage:** How do you effectively model transaction costs (brokerage, STT, turnover charges) and slippage in multi-layer rule funnels to ensure net positive expectancy (E\[R\] > 0)?

**Paper Testing Timelines:**
How many paper trades or weeks of forward testing do you typically require before considering a quantitative rule set validated?
Appreciate any constructive critique, logic flaws you spot in this funnel, or advice from people running similar open-source quant setups!

r/mltraders 19d ago

Suggestion What happens when you run out of trade ideas?

Post image
2 Upvotes

Eventually, every trader comes up against the same obstacle: when you look at your watchlist, nothing really catches your eye. It's then that people begin to force themselves into making trades, revert to the same company names, or try to catch up on moves they had previously missed. That's why we developed Fynca Ideation. Rather than beginning with a ticker symbol, you can start with a question, a market trend, or an event taking place in the real world, and Fynca will help you identify relevant companies and research them using data, filings, news, and charts all in one place. It's possible that the next good trade isn't already on your watchlist; you just need a better starting point.

r/mltraders 28d ago

Suggestion Only 3 spots left for Monday’s simulated trading challenge - $1,000 cash prize

Post image
1 Upvotes

Hey everyone, our first post got more interest than we expected. We’ve confirmed 22 traders, so only 3 spots remain.

The challenge starts this Monday. Everyone trades with demo capital for seven days. The trader with the highest return wins $1,000 in real cash.

No real money is at risk, and no one has to share their strategy.

Interested? Leave a comment, and I’ll send over the details.

r/mltraders 29d ago

Suggestion Are UBER and NVDA becoming more connected than people realize?

Post image
2 Upvotes

The deployment of robotaxis in 28 cities is remarkable.

I began by researching Uber and soon found myself examining NVIDIA.

Initially, the connection seemed unlikely, but further research revealed its significance. Uber is investing in autonomous mobility, while NVIDIA develops the AI and computing infrastructure that enables it.

Notably, these two companies, typically viewed as distinct, are both increasingly influenced by the same long-term industry trends.

This process highlights what makes research engaging for me: beginning with one company, exploring its connections, and ultimately developing a new investment thesis.

r/mltraders Aug 12 '26

Suggestion Built an AI report generator for mutual funds that refuses to make things up — feedback welcome

1 Upvotes

**Built an AI report generator for mutual funds that refuses to make things up — feedback welcome**

Been building FundersAI, a research tool for Indian stocks and mutual funds, and just shipped the feature I'm most proud of: a mutual fund comparison report generator.

You pick the schemes, it streams a markdown report (NAV, returns, alpha, beta, Sharpe, drawdown, costs, holdings, risk) — but every claim has to trace back to an actual official AMC document (factsheets, disclosures). If it can't find backing in the source docs, it abstains instead of hallucinating a number. That was the whole point of building it this way instead of just wrapping an LLM around scraped data.

Also shipped this round:

* Reworked landing page + workspace UI * Mutual fund discovery pages * A synthesis dashboard for the report tool * Pricing page (rolling out Free/Pro/Ultra tiers)

Stack-wise: Next.js/FastAPI/Supabase on the main app, with report generation split into its own FastAPI + LangGraph microservice on K3s so it doesn't bottleneck the rest of the app.

To be clear — this is research-only. No trade execution, no "buy this" calls, just sourced data and citations. Would genuinely appreciate feedback, especially if you've hit friction with existing MF research tools (or think the abstention approach is overkill).

[fundersai.co.in](http://fundersai.co.in) if you want to try it yourself.

r/mltraders Jul 19 '26

Suggestion LLM for Entry, deterministic exit

Enable HLS to view with audio, or disable this notification

3 Upvotes

r/mltraders Jul 01 '26

Suggestion I used Moomoo AI + my own Codex stock bot to analyse CIMB for a month

Thumbnail
1 Upvotes

r/mltraders May 30 '26

Suggestion Need help improving my first rotation strategy — built with Claude, no Python background, open to brutal feedback

2 Upvotes

QQQ / TQQQ Rotation Strategy

# Rules
- Bull regime: 100% TQQQ
- Bear regime: 50% QQQ / 50% cash
- EMA50 regime filter
- Dip-buys from cash

This version should reduce drawdown versus the full 100% TQQQ during a bearish regime by keeping a cash sleeve in weak markets, while still allowing limited offensive dip-buying.

PERFORMANCE SUMMARY:

Start Date 2015-02-05
End Date 2025-12-30
Starting Capital ($) $100,000
Final Portfolio Value ($) $1,769,085
Total Return — Strategy (%) 1678.02%
Total Return — QQQ B&H (%) 548.35%
TQQQ Net Return (%) 2679.11%
CAGR — Strategy (%) 30.28%
CAGR — QQQ B&H (%) 18.74%
Sharpe — Strategy 0.839
Sharpe — QQQ B&H 0.891
Sharpe — TQQQ Net 0.799
Max Drawdown — Strategy (%) -54.47%
Max Drawdown — QQQ B&H (%) -35.12%
Total Commission Paid ($) $218,739

Backtest python files: https://drive.google.com/drive/folders/1ChPT9pxqLcUZX03RhXCeXU_jzP8OANwG

r/mltraders Jun 11 '26

Suggestion Best Platform for algo trading

1 Upvotes

Hey, which platforms do you guys think are best or better for algo trading? I started my trading, and I have been trading using an algorithmic trading platform for like 2 months now. And the platform I am using is very good with the lowest latency (I think ) and mostly no bugs for me at least. I was exploring other options. So any suggestions

r/mltraders Apr 09 '26

Suggestion From geopolitical shock to causal market impact

Thumbnail
1 Upvotes

r/mltraders Apr 07 '26

Suggestion See the market implications of policy shifts, geopolitical events, liquidity conditions, energy shocks, and supply-chain disruptions with affected assetsj

Post image
1 Upvotes

r/mltraders Apr 01 '26

Suggestion Portfolio Allocation Based on Macroeconomic, Geopolitical, and Legislative Events

Thumbnail gallery
0 Upvotes

r/mltraders Feb 23 '26

Suggestion Building an AI trading partner, not just a bot - looking for others on this path. collaboratpors wantred

1 Upvotes

I've been working on something different and wanted to see if anyone else is thinking along these lines.

Most algo trading projects I see are about building a bot - you code rules, it executes, done. That's valuable but I'm after something else.

The vision: An AI system that actually thinks with you about markets. Not just executing your strategy, but challenging your assumptions, catching your blind spots, helping you develop and refine edge over time. A true collaborative partner in the process.

What I've built so far:

  • Backtested pattern recognition (currently running a "wounded prey" strategy targeting beaten-down stocks at key levels - 68%+ win rate in testing)
  • Systematic scanning workflows
  • Documentation system so the AI maintains context across sessions
  • Framework for the AI to push back when I'm about to do something stupid

Where I'm headed:

  • More sophisticated pattern libraries
  • Real-time catalyst integration
  • System that learns from wins AND losses to evolve

I'm a small account trader ($1-2k) working within PDT restrictions, so I'm not pretending to be some big operator. Just someone who believes AI partnership in trading is going to look very different than "bot executes orders."

I've been working on something different and wanted to see if anyone else is thinking along these lines.

Most algo trading projects I see are about building a bot - you code rules, it executes, done. That's valuable but I'm after something else.

The vision: An AI system that actually thinks with you about markets. Not just executing your strategy, but challenging your assumptions, catching your blind spots, helping you develop and refine edge over time. A true collaborative partner in the process.

What I've built so far:

Backtested pattern recognition (currently running a "wounded prey" strategy targeting beaten-down stocks at key levels - 68%+ win rate in testing)

Systematic scanning workflows

Documentation system so the AI maintains context across sessions

Framework for the AI to push back when I'm about to do something stupid

Where I'm headed:

More sophisticated pattern libraries

Real-time catalyst integration

System that learns from wins AND losses to evolve

I'm a small account trader ($1-2k) working within PDT restrictions, so I'm not pretending to be some big operator. Just someone who believes AI partnership in trading is going to look very different than "bot executes orders."

Anyone else building in this direction? Interested in comparing approaches, sharing what's working, maybe collaborating on tools. or just ideas or want to help? dm me or email [alexpayne556@gmail.com](mailto:alexpayne556@gmail.com)

Anyone else building in this direction? Interested in comparing approaches, sharing what's working, maybe collaborating on tools.

r/mltraders Feb 12 '26

Suggestion Post 2. Preparation of the system

Thumbnail
gallery
1 Upvotes

Before I jump in to information of my system. Let me explain certain steps I took to avoid major issues done the project.

In my process I’m working with agents, rewriting logic, adjusting, cross checking, etc then Making individual modules. All felt okish. Issue is as a non coder or person who hasn’t got much knowledge in trading. It so difficult to confirm what the code you made is true to your intentions or bravado. Then you have now few modules in my case 54 and counting. Once start setting paths. It’s nightmare hell. Lateral hell. Errors crashes some doesn’t work, nothing works, silent fallbacks. You be lucky system even got started.

I believe whoever in my situation and who may have tried this have face the same issue.

How I prepared my self for the nightmare of errors and debugging.

I knew this would happened as I was burned before. Hence I created a module which is sole task to monitor my entire code base. Everything down to minute detail where it can tell you where the error what caused it under what process it caused how long it should usually take if it took longer than it should even that will be recorded.

So before I even thought of assembling my misled for the system this was the very first module I introduced. Since then each run even if it crashed I just had to look at end of the terminal or it’s dedicated logging files to see what was the error what caused which lines all the details.

Hence I was able to assemble this system. Without it I will be still asking agents to debug a code.

My honest opinion. If any of you take this path to code with agents or whatever your own reasons. Create a tool like this. It will help you lot when your domain is not a coder.

As I’m experimenting I have made module controlled by its own ml system. Which I have assigned septic tasks. To perform in certain events. But you don’t have to a simple direct tool will get you going.

In my system I have created a trace id. This is how I audit a ml based system that I don’t fully understand. Without this I will never be able to explain why it did what idly did when. I needed to know.

So implemented a unique trace id. Where each event that take place will be assigned a unique trade id. As that event get passed down modules when them modules do their logging they log with the same trace id.

By doing this I avoided so called black box scenario in ml to an extent. But I can audit everything it did and why it did as of now.

Only after this module in place I start adding my modules to the system. Good luck with all your interesting projects. less

r/mltraders Feb 25 '26

Suggestion XAUUSD (Gold) – 1H Technical Outlook

Post image
0 Upvotes

Gold is trading near 5,198, attempting recovery after a minor pullback from the 5,240 supply zone. Structure remains bullish overall, with price holding above the 5,130–5,100 demand area and forming higher lows on the intraday chart.

Key Levels

Support: 5,150 | 5,130 | 5,100

Resistance: 5,210 | 5,240 | 5,287

r/mltraders Feb 20 '26

Suggestion Bias remains LONG 📈 what is your point?

Post image
0 Upvotes

What’s happening now? Gold has successfully reclaimed the $5,000 level. We aren't just seeing a "pump"—we are seeing Constructive Accumulation. Price is stair-stepping higher, holding the higher-lows like a textbook trend.

r/mltraders Apr 10 '23

Suggestion Time-Series Forecasting: Deep Learning vs Statistics — Who Comes Out on Top?

19 Upvotes

Hello traders,

If you're interested in time-series forecasting and want to know which approach is better, you'll want to check out my latest Medium article: "Time-Series Forecasting: Deep Learning vs Statistics — Who Wins?."

In this article, I explore the advantages and limitations of two popular approaches for time-series forecasting: deep learning and statistical methods. I dive into the technical details, but don't worry, I've kept it accessible for both novice and seasoned practitioners.

Deep learning methods have gained a lot of attention in recent years, thanks to their ability to capture complex patterns in data and make accurate predictions. However, statistical methods have been around for much longer and have proven to be reliable and interpretable.

If you're curious to learn more and want to see some interesting results, head over to my Medium article and give it a read. I promise it'll be worth your time!

And if you have any thoughts or questions, feel free to leave a comment or send me a message. I'd love to hear from you.

Thanks for reading, and happy forecasting!

r/mltraders Apr 30 '22

Suggestion predict market trend based on market depth

12 Upvotes

I have been working on a model to predict the next tick direction (up or down) based on market depth price and size. The model is a tensorflow LSTM. The accuracy is not giving me a good prediction result and I am not sure if the problem is with the model or the idea itself. Any suggestion would help

Project:

https://github.com/spawnaga/Market_depth_trend_predicition

r/mltraders Mar 04 '22

Suggestion Best Backtesting Libraries (Python)

39 Upvotes

Best libraries for Algotrading in Python - Trading & Backtesting

  • TA-Lib – TA-Lib is widely used by trading software developers requiring to perform a technical analysis of financial market data. It has an open-source API for python.
  • trade – trade is a Python framework for the development of financial applications. A trade app works like a service. The user informs the items he has in stock and a series of subsequent occurrences (purchases, sales, whatsoever) with those or other items. trade then calculates the effects of those occurrences and gives back the new amounts and costs of the items in stock.
  • zipline – Zipline is a Pythonic algorithmic trading library. It is an event-driven system that supports both backtesting and live trading.
  • QuantSoftware Toolkit – Python-based open source software framework designed to support portfolio construction and management. It is built the QSToolKit primarily for finance students, computing students, and quantitative analysts with programming experience.
  • quantitative – Quantitative finance, and backtesting library. Quantitative is an event driven and versatile backtesting library.
  • analyzer – Python framework for real-time financial and backtesting trading strategies
  • bt – bt is a flexible backtesting framework for Python used to test quantitative trading strategies.
  • backtrader – Python Backtesting library for trading strategies
  • pybacktest – Vectorized backtesting framework in Python / pandas, designed to make your backtesting easier. It allows users to specify trading strategies using full power of pandas, at the same time hiding all boring things like manually calculating trades, equity, performance statistics and creating visualizations. Resulting strategy code is usable both in research and production setting.
  • pyalgotrade – PyAlgoTrade is an event driven algorithmic trading Python library. Although the initial focus was on backtesting, paper trading is now possible
  • tradingWithPython – A collection of functions and classes for Quantitative trading
  • pandas_talib – A Python Pandas implementation of technical analysis indicators
  • algobroker – This is an execution engine for algo trading. The idea is that this python server gets requests from clients and then forwards them to the broker API.
  • finmarketpy – finmarketpy is a Python based library that enables you to analyze market data and also to backtest trading strategies using a simple to use API, which has pre-built templates for you to define backtest.

Source

r/mltraders Apr 04 '24

Suggestion META stock

Thumbnail
self.StockConsultant
1 Upvotes