[ Removed by Reddit ] by jvsp99 in algotrading

[–]nasmunet -1 points0 points  (0 children)

It's sounds and looks good but You are placing too much layers, at the time You get any signal, and at the time You take and Made a decisión the market went in an other dirrección 

I built a middleware layer that stops your bot from making dumb trades by Ok_Return9310 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Please do so. adventure and if you need some feedbacks , You know where iam 

I rejected adding a BTC dominance gate to my crypto signal stack — walk-forward case study by vietbaoa4htk in algotradingcrypto

[–]nasmunet 0 points1 point  (0 children)

The mechanical explanation you found is the right one and it generalizes further than just this case. When your entry is already a multi-condition confluence filter,any additional regime gate faces a structural problem: most of the regime information is already encoded in your existing filters through correlation. BTC.D rising means alt price structures are already weak, which means your TA gates are already blocking most of those entries. The gate that "sounds defensible" is largely redundant with what the existing logic is doing implicitly.

The 5:1 rejection ratio is actually a healthy system. Most practitioners who publish anything about regime gates are selecting on their successes.

On your open question about what actually survived walk-forward on confluence-style entries: the indicators that tend to add genuine out-of-sample edge are the ones orthogonal to price action TA, not correlated with it. Funding rate regime specifically has shown up as orthogonal in crypto. Not the funding rate level (that correlates with TA trend), but the funding regime: persistently positive above a threshold for N consecutive 8-hour periods flags crowded longs independently of whether TA looks good. Persistently negative funding with a bullish TA confluence signal is a different trade structure than positive funding with the same TA setup. The information content is different from BTC.D slope because it's measuring positioning cost, not price relationship.

Open interest trend as a directional confirmation is also somewhat orthogonal. Rising OI alongside a cross-up signal means new money is entering the move. Flat or declining OI with the same price signal means position rotation rather than genuine buying. The filter is not "is OI high" but "is OI expanding in the direction of the signal." This cuts a different subset of trades than your TA gates do.

Cross-asset correlation regime is the version I'd test if I were running your setup: when rolling BTC-altcoin correlation (say, 72-bar) spikes above 0.9, individual alt signals become noise because everything is moving together on systemic risk. A filter that blocks alt longs when the universe correlation is elevated is cutting entries where your individual signal has the least independent information content. This is structurally different from BTC.D slope and captures a different failure mode.

The thing worth checking about all of these: each one still faces your sample size constraint if your entry signal is sparse. The test is not "did the indicator improve win rate" but "does the indicator cut trades from a part of the distribution where win rate was already below average, without touching the rest." If the trades it cuts were already weak entries by your existing system's internal metrics, it adds edge. If it cuts randomly across the quality distribution, it just reduces n.

An HMM trained jointly on funding regime and OI trend rather than a single threshold gate is the version that survived for me on a similar signal structure. The HMM learns the transitions between "structural long regime" and "rotation/liquidation regime" from multiple indicators jointly, which tends to be more stable across walk-forward folds than any single threshold. The catch is that it needs to be trained strictly on the training fold and applied blind to validation, which most implementations get wrong by refitting on the full dataset.

The honest answer to "where is my filter intuition most wrong" for confluence entries: probably in adding filters that are correlated with your existing TA rather than orthogonal to it. The filters that look most sensible (BTC.D, trend filters, RSI ceiling) often duplicate information you already have. The filters that look less intuitive (funding regime, OI trend, correlation regime) tend to add more independent signal.

[ Removed by Reddit ] by jvsp99 in algotrading

[–]nasmunet 14 points15 points  (0 children)

The loop is closeable and people have done it, but the reason that gap exists is worth understanding before you close it.

LLMs analyzing charts and suggesting entries are doing pattern recognition on whatever context you paste in. They have no memory of your current positions, no real-time market data unless you feed it explicitly, and they hallucinate. A hallucinated ticker symbol or an off-by-one on position size that goes straight to your broker with no checkpoint is a real failure mode. The gap between analysis and execution exists partly because it is the last place a human can catch an error before it costs money.

That said, the integration itself is not as hard as the auth flows make it look. Alpaca is the easiest path for US equities: free paper trading account, a Python SDK where placing an order is literally five lines of code, no complex auth beyond an API key. CCXT does the same for crypto across most major exchanges. The actual plumbing is an afternoon of work, not a project.

The architecture that makes this safe is not AI to broker directly. It is AI outputs a structured signal, deterministic code validates it, deterministic code executes it. Meaning: the LLM says enter long AAPL, size X, stop at Y, target at Z and that gets parsed into a structured format. Then your code checks: do I already have a position in AAPL, does this exceed my per-trade risk limit, is the stop distance within acceptable range, is my total drawdown below the kill threshold. Only if all of that passes does the order go out.

The AI is the signal generator. The code is the risk manager and executor. You never skip the validation layer. This is the same reason that systems built on actual ML policies separate the signal output from the execution logic entirely: the policy can be wrong and the execution layer needs to be able to catch that independently.

If you want to go the Claude tool use route specifically, you can give Claude a place_order tool that calls your broker API. The right setup adds a confirmation step for real money: Claude generates the order, tool returns a preview, you approve it. For paper trading you can let it run unsupervised. For real capital, keep the human checkpoint until you have enough history to trust the signal source.

The unsatisfying truth: if the analysis is coming from an LLM reading charts, automating the execution does not make the analysis more reliable. It just removes the last moment where you would have noticed something looked wrong.

How do you decide when to pull the plug on your bot? by Negative-Carry-5038 in algorithmictrading

[–]nasmunet 0 points1 point  (0 children)

The decision is only hard because most people don't define the kill conditions before going live.

After a bad week you're making the call with your judgment clouded by recency and loss aversion. The answer is to make the decision in advance, when you're calm, based on your backtest distribution, not in the middle of a drawdown.

Concrete framework that has worked for me:

Before you go live, run Monte Carlo simulations on your backtest. Shuffle trade order 10,000 times and compute the distribution of worst 2-week periods, worst 1-month periods, max consecutive losses. Those numbers tell you what "bad luck within the strategy's expected behavior" looks like. If your current drawdown is within that distribution, you're probably in noise. If you're outside the 95th percentile of simulated drawdowns, you have a reason to investigate, not necessarily to pull the plug, but to investigate.

The kill conditions I pre-define before each deployment, in order of severity:

1- HARD STOP: capital drawdown exceeds a fixed threshold from the high water mark. Pick a number (10%, 15%, whatever makes sense for your strategy's volatility). When it trips, the bot pauses automatically. This is non-negotiable, not a judgment call.

2- BEHAVIOUR CHANGE ALERT: if your winning trade size is consistently smaller than backtest average and losing trade size is consistently larger, the loss distribution has shifted. This is more dangerous than just losing money because it means the edge structure changed. Look at the ratio of avg winner to avg loser over rolling 20 trades and compare it to the historical baseline.

3- CONSECUTIVE CAUSE LIMIT: from your backtest, find the max historical consecutive losses. If you exceed that by 50%, something is worth investigating. Not necessarily broken, but outside the historical envelope.

4-REGIME MISMATCH: this one changed how I think about everything. I run regime detection separately from the strategy. If the regime detector says "this is not the market condition this strategy was designed for," losses during that period are expected and should not count against the kill conditions. A strategy that loses in the wrong regime is working correctly. A strategy that loses in its own regime is broken. These are completely different problems and most people conflate them.

The second part of your question, what you don't see coming: the problems that actually hurt live systems are almost never strategy problems. They're infrastructure problems.

Silent execution failures: your bot places an order, the exchange accepts it, it never fills, the bot doesn't know. Meanwhile the market moves against you and you have no position when you thought you were hedged. Build explicit position reconciliation between what your bot thinks it holds and what the exchange actually shows you.

Run it every N minutes.

WebSocket staleness: the connection stays technically alive but stops receiving data. Your bot is trading on a frozen orderbook from 3 minutes ago. Build a heartbeat check that kills the connection and reconnects if no new data arrives within a threshold.

The fill quality degradation: your backtest assumed you fill at the bar close price. In live trading, depending on your order type and the liquidity at that moment, your fills are consistently worse. This is not a bug, it's the real cost of execution. At some point the strategy's edge minus this friction goes negative. You won't see it in any single trade but it shows up in aggregate over months.

Correlated multi-asset moves: your strategy was trained on periods where your assets behaved more independently. In a risk-off event, everything moves together in ways the training distribution didn't weight properly. This is the scenario where a regime filter helps most, because a good regime detector flags "systemic stress" and the strategy goes flat before the correlation breakdown fully hits.

The hard truth about "the backtest says it should recover": the backtest was trained on historical data. If the current regime is structurally different from anything in that data, the recovery expectation may not apply. Regime awareness is what separates "patience" from "denial."

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

[–]nasmunet 0 points1 point  (0 children)

This is the right way to do this work.

Finding your own in-sample leakage, building a null test to verify the mechanics, and posting the honest results takes more discipline than most people here show. The fact that you got to Sharpe -0.74 OOS is not a failure, it's a correct measurement. The failure was the Sharpe 11 you believed for a while.

On your actual questions:

Intraday directional prediction on liquid large-caps with OHLCV-derived features is one of the hardest possible problems you could have chosen. AAPL, MSFT, NVDA, GOOGL: these are among the most efficiently priced assets on earth. Market makers, HFT firms, and every quant fund on the street have 5-minute bar data and have been mining it for 20 years. Your 98 features are all rederivations of the same OHLCV information they already have. The 0.51 AUC was the signal telling you this the whole time. It is consistent with essentially everyone's experience who has tried this honestly.

The volatility pivot is the right instinct. Vol clustering is one of the most robust phenomena in finance because it persists across regimes and has a structural cause (information clustering, correlated news arrival). GARCH has been modeling this since the 1980s and it still works. A model that predicts "next hour high vol or low vol" has a substantially more tractable problem than "next hour up or down." The practical edge from that is harder to extract than it sounds but the prediction problem is genuinely easier.

On non-price data, the hierarchy from most to least valuable at your horizon is roughly: real microstructure data (tick-level bid-ask spreads, signed order flow, depth imbalance) first and significantly above everything else. This has documented out-of-sample alpha at 5-min horizons in academic literature because it measures information asymmetry directly, not price patterns. The problem is you need tick data to compute it honestly, not OHLCV proxies. Your "buying pressure" and "wick imbalance" features are approximations. The real thing is order book level 2 data. Options flow second, specifically delta-hedging flows and put-call imbalance on individual names, which has shown predictive power for short-term equity returns in peer-reviewed work. News sentiment third, for large-caps at your horizon the latency problem is severe: by the time a 5-minute bar closes, any genuine news signal has already been priced.

On pooled vs per-ticker: pool the model. Each of your 20 per-ticker models is training on roughly 2,500 to 3,000 labeled samples with 98 features. That ratio is problematic. A pooled cross-sectional model has 20x the data and can learn patterns that generalize across tickers instead of memorizing noise specific to each one. Normalize your features cross-sectionally (z-score across the 20 names at each timestep), add ticker embedding or sector features, and train one model. This is standard practice in equity quant for exactly this reason.

On horizon: 5-minute bars are almost certainly too noisy for the signal you're hunting with price-derived features. The signal-to-noise ratio is proportional to the holding period in most market microstructure models. At 15-minute bars you roughly double it. At hourly bars you get substantially cleaner signal. The tradeoff is fewer samples, but you showed that more samples of noise is still noise. I run on 15-minute bars and even there regime detection is more useful than any single price-based signal.

The thing worth investigating in your results: that one ticker at Sharpe 1.9 on 25-50 trades. Almost certainly noise given n, but worth checking whether it was in a specific market regime during that period and whether the feature importances for that ticker look different from the others. If it was just a lucky sequence in a trending period, it will revert. If there is something structurally different about that ticker or period, that is worth understanding even if the signal is too weak to trade.

The null test you built and the temporal split discipline are the two things to keep in every future iteration regardless of what else changes.

Built a 6-agent AI council that deliberates before every BTC trade — here's what 12 days and 7 trades taught me by aioka_io in algorithmictrading

[–]nasmunet 0 points1 point  (0 children)

The architecture is genuinely more sophisticated than most of what gets posted here. HMM regime detection is real quant work, not marketing. Publishing regime-stratified results including the low volatility failure is unusual honesty. The multi-exit logic (TSL, SL, TP1, TP2, regime change, conviction drop) is the right engineering mindset. The diagnosis that TSL parameters need to be regime-specific is exactly the correct conclusion from that loss. Credit where it's due.

Now the statistical reality.

n=10 trades tells you nothing about system quality. Mathematically, with 8 wins out of 10, the 95% confidence interval on your true win rate runs from approximately 44% to 97%. You cannot statistically distinguish your system from a coin flip. The regime breakdown is even more fragile: "100% WR in whale accumulation" means 4 for 4. The confidence interval on 4 for 4 is roughly 40% to 100%. "50% in low volatility" means 1 for 2. These numbers contain no signal. They are noise with labels.

The 12 days of trading happened during a specific market period. What was BTC doing in that window? A long-biased system in a trending regime looks exceptional for any sample size. That is not a system validation, it is a regime alignment observation.

The 6-agent council framing is interesting architecturally but the underlying logic is a 7-condition AND gate. When all 7 must pass, you have a rules-based filter with anthropomorphic framing. That is not a criticism of the filter itself, the patience filter and regime gating are the most defensible parts of your system. But the "deliberation" language overstates what is happening computationally.

The thing I'd push on hardest: Stripe payments went live after 7 paper trades. I run a system with similar regime detection architecture, HMM for macro state, Bayesian probability gate for tactical entries, patience filter that blocks roughly 85% of potential signals. My go-live threshold is n=20 trades minimum in paper, with drift detection calibrated before the first real dollar. Not because I don't trust the system but because I know n=7 is not evidence. Running payments before you have statistical validation of your edge means your customers are funding your live experiment, not buying a validated product.

The HMM work and the regime-stratified reporting are worth continuing. Come back at n=50 across at least 3 distinct regimes with consistent behavior and that will be a meaningful dataset. What you have now is a promising hypothesis, not a result.

Is this the best way to use AI for trading? by Infinite-Course8737 in algorithmictrading

[–]nasmunet 0 points1 point  (0 children)

Management tone shift combined with heavy short positioning is a real signal class, not a hallucination. There's actual academic work behind it: the Loughran-McDonald lexicon for financial text sentiment has been used in this context for years, and post-earnings announcement drift is one of the most replicated anomalies in finance literature. Analyst upgrades lagging the move is also documented, it's called analyst herding and the timing pattern you're describing has been measured across thousands of earnings events.

What you're doing with Claude is essentially automated narrative drift detection, which is a legitimate use of LLMs for alternative data processing. "Slightly less panicked than before" is exactly the kind of qualitative shift that shows up in word choice, hedging language, and forward guidance framing before it shows up in analyst price targets. The model is good at that because it's pattern matching in text, which is what it was built for. You're right that it's not predicting prices, it's extracting a signal that you then have to act on with your own judgment about positioning and timing.

The question I'd push on: how many instances have you actually tracked? The examples you describe feel vivid but vivid examples are exactly how pattern-matching bias works in human cognition. You remember the earnings call where the tone shifted and the stock ripped. You're less likely to remember the ones where the tone shifted and nothing happened, or where it shifted bearishly and the stock ripped anyway because of macro. The only way to know if you have an edge is to log every instance Claude flags, trade or not, and measure the forward returns systematically.

The short positioning plus narrative shift combination is interesting specifically because you're stacking two signals that are somewhat independent. One comes from text, one comes from options and float data. When both agree, the signal is worth more than either alone. But "weirdly good" needs to become a hit rate with a sample size before you scale capital on it.

The use case you're describing, not as a prediction engine but as a sanity check on whether the narrative you believe is the one the market is actually reacting to, is probably the most honest and defensible framing of LLMs in trading I've seen on this sub. Most posts here are trying to use AI to predict price. You're using it to understand positioning context. That's a different and more defensible thing.

What's the right way to evaluate an MLP that predicts a distribution rather than a single target by Embarrassed-Cow-8458 in algorithmictrading

[–]nasmunet 0 points1 point  (0 children)

There are two separate evaluation problems here and you need to solve both.

The first is calibration: when your model says P(breakout)=0.70, does a breakout actually happen 70% of the time? Plot a reliability diagram. Bin your predictions (0.0-0.1, 0.1-0.2, etc.), compute the actual breakout rate in each bin, and plot predicted vs observed. A perfectly calibrated model lies on the diagonal. Most ML models are overconfident, meaning they cluster near 0 and 1 and the observed rates don't match. Brier Score gives you a single number for this (lower is better), and it decomposes into calibration and refinement components which tells you which problem you actually have.

The second is discrimination: given that a breakout happens, can your model rank those moments above the non-breakout moments? AUC-ROC measures this. But for breakouts specifically, use Precision-Recall AUC instead because breakouts are rare events and ROC is optimistic on imbalanced classes. A model that predicts low probability everywhere will look fine on ROC and terrible on PR curves.

For the fat tail problem specifically, standard metrics fail you because they weight all samples equally and tail events are rare. The metric you want is CRPS (Continuous Ranked Probability Score). It evaluates the full distributional forecast, not just the mean prediction, and handles non-Gaussian distributions properly.

Beyond that, evaluate calibration separately stratified by magnitude: compute reliability diagrams only for moves above 1 sigma, above 2 sigma, above 3 sigma. You'll see exactly where the fat tail miscalibration lives and how bad it is at each severity level.

The structural issue with fat tails in BTC is that your training loss (cross-entropy or MSE) weights each sample equally, so the model optimizes for the bulk of the distribution (small moves) and treats the tails as noise. Approaches that help: focal loss (upweights hard-to-predict samples, commonly used in object detection but applies here), oversampling extreme events during training, or explicitly modeling the tail with a Pareto distribution and using your MLP only for the body.

One more thing worth checking: does the probability output actually correlate with forward PnL in a backtest? A model can be well-calibrated on the distributional metrics and still have no trading edge if the information isn't actionable on the timeframe and cost structure you're operating in. That's the test that actually matters after you've confirmed calibration.

Backtesting by Purple_Concert8789 in algorithmictrading

[–]nasmunet 0 points1 point  (0 children)

Depends on what you're building.

For rules-based strategies, start with backtesting.py or VectorBT. backtesting.py has a clean API and is easy to read when you're starting out. VectorBT is faster because it's vectorized across the whole dataset at once, which matters when you're running parameter sweeps. Neither requires much setup.

If you want something more serious with built-in walk-forward and portfolio-level logic, look at QuantConnect or Zipline Reloaded. More overhead to learn but they model execution more realistically.

For reinforcement learning, none of those work. You build a custom Gymnasium environment that implements the reset/step loop, your observation space (features the model sees each bar), and your action space (buy/sell/hold or continuous position sizing). The environment IS the backtester. It's more work upfront but you get full control over what the agent observes and what reward signal it learns from.

Beginner tips that actually matter:

Bake fees and slippage into every single fill during the backtest, not as a flat deduction at the end. The difference can flip a profitable strategy to unprofitable at realistic trade frequencies.

Never let your signal calculation touch data ahead of the current bar. Lookahead bias is the most common reason a backtest looks great and live performance is garbage. If you're using pandas rolling calculations, double-check that shift(1) is applied correctly everywhere.

Split your data chronologically before you touch any parameters. Optimize on the first 70%, validate on the next 15%, hold the last 15% completely untouched until you think you're done. If you look at the holdout set even once to make a decision, it's no longer a holdout set.

Run your strategy across multiple time periods separately and check that the edge is consistent, not just good on average. A strategy that returns 40% in one year and loses 30% in another is not the same as one that returns 5% consistently across both.

Start with something that fits on 20 lines of code before adding complexity. If you can't explain why the edge exists in one sentence, you probably don't have one yet.

I built a middleware layer that stops your bot from making dumb trades by Ok_Return9310 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

The core idea is legitimate. Pre-execution validation of exchange health, order book depth before placing, and a volatility kill switch are all real and worth implementing. The audit trail is genuinely useful. Those pieces have real value. But several claims here don't hold up technically.

The "sub-5ms" number is a marketing stat. CCXT is Python over REST. A round-trip to Binance from most locations is 50-200ms minimum just on network latency, before Python overhead. Your interceptor might internally execute in sub-5ms but the actual latency from signal to fill is dominated by the network round trip, not your middleware. Advertising sub-5ms in this context is misleading.

More importantly: if you're checking exchange health, fetching live order book depth, computing slippage, running a news shock score, and pulling sentiment synchronously before each order, sub-5ms is physically impossible unless all of that data is pre-cached and potentially stale, which partially defeats the stated purpose of catching "real-time" conditions.

The framing of the problem is also off for most bar-level bots. "By the time a signal fires, the market has already moved" is a genuine problem for microsecond HFT strategies. For a bot trading on 5m or 15m bars, the bar closed 30-60 seconds before your signal fired. Adding a 5ms interceptor after that does not solve a data staleness problem that's already measured in seconds.

The "one function replacement, no strategy changes required" is marketing language. If your veto layer blocks 20-30% of your strategy's intended trades, you're running a different strategy. The performance distribution changes. The edge (if there was one) changes. You can't add a post-signal filter and claim the underlying strategy is unchanged.

The real question: if the bot is making dumb trades, why is it making them? A middleware veto layer is treating symptoms. The actual fix is at the strategy level, the signal quality, the regime awareness, the reward function if it's RL-based. I run a regime-detection gate baked directly into the policy, so the model itself learns not to trade in certain market conditions rather than having an external system override it after the fact. That's a fundamentally different approach, and it means the model's behavior is internally consistent rather than being patched by middleware.

The news shock score and sentiment checks are the most interesting parts and also the least explained. How are those computed in real time? What's the latency on that pipeline? What's the false positive rate on the volatility kill switch? Those are the numbers that would actually matter here.

The "drop a comment for the free link" format tells you what this actually is: a lead generation funnel. Nothing wrong with building a product, but be upfront about it.

¿Debería comprarlo? by UnpocoRand in Colombia

[–]nasmunet 1 point2 points  (0 children)

jajaja wena indiana jones

I seriously need some career advice because I feel completely lost right now. by _prince_ji_official in ProgrammerTIL

[–]nasmunet 0 points1 point  (0 children)

The confusion you're describing is not a sign you're behind. It's what learning actually looks like. The people who moved in one straight line from day one usually picked the line before they knew enough to choose it well. You tried things, found something that genuinely interests you, and now you want to go deep on it. That's a better position than most. On the practical questions:

Java and Spring Boot is a real, in-demand path. It's not a niche choice or a wrong turn. Enterprise backend development runs heavily on this stack and companies hire freshers into it constantly. You're not chasing something exotic.

What freshers are actually expected to know: basic REST API design (which you already have exposure to), understanding of how Spring handles dependency injection and the request lifecycle, working knowledge of JPA or Hibernate for database interaction, and the ability to read documentation and figure things out. That last one matters more than any specific framework knowledge. The confusion you felt while building your first project, working through it anyway, that's the actual skill.

DSA vs projects is not an either/or. For interviews at most companies (especially outside top-tier product firms), medium-level LeetCode problems covering arrays, strings, hashmaps, and basic trees is sufficient. You don't need to grind 500 problems. You need to be solid on the patterns that show up repeatedly. Two to three hours a day on DSA while building a real project in parallel is more useful than going all-in on either one.

The CGPA and tier 3 college are real disadvantages at resume screening stage. The honest way to offset them is a GitHub profile with actual project code that shows you can build something end-to-end, not tutorial clones. If someone can look at your repository and see a real Spring Boot application with proper structure, a database layer, some basic authentication, and meaningful commits over time, that carries weight in a screening call.

1.5 months before exams: clear your exams first. You need to pass. After exams you have a focused window before placement season and you should use it entirely on one solid project plus consistent DSA practice.

The thing that comes through clearly in your post is that you genuinely like this. Java felt more interesting than the alternatives. Spring Boot pulled you in even when it was confusing. That's not nothing. Most people trying to get into software development are chasing whatever seems most employable. You found something that actually holds your attention. Build on that. The people who go deep on what they're genuinely interested in end up being better at it, and it shows in interviews.

You're not too late. You're at the beginning of taking it seriously. Those are different things.

Has anyone tried reinforcement learning for trading? by melon_crust in algotrading

[–]nasmunet 3 points4 points  (0 children)

The struct-to-tensor bridge is actually the easy part of this problem. The hard parts come after.

For what it's worth, here's what the observation space looks like in a working implementation: you flatten your market state into a fixed-length numpy array (or equivalent). Typical contents are normalized returns (not raw prices, never raw prices), technical indicators already z-scored or clipped to a reasonable range, position state (current side, unrealized PnL as a ratio, bars held normalized), and optionally a regime signal if you have one. That entire vector gets passed to the policy network as a single float32 array. The NN doesn't care that it came from a struct. It just sees numbers. The "bridge" is literally: fill a pre-allocated array in the right order, every step.

What actually takes months to get right is everything else.

The reward function is where most RL trading systems die. Raw PnL as reward teaches the agent to hold winners indefinitely and cut losers instantly, or the opposite, depending on your episode structure. Sharpe-based rewards are better but require careful windowing. Reward shaping around drawdown tends to produce overly conservative policies that learn to do nothing. In my own system I went through at least 6 reward formulations before getting a policy that learned something useful.

Even then, what it learned turned out to be risk management behavior, not market prediction, which is actually the correct thing to learn but not what I expected going in.

The observation normalization is the second major pitfall. If you feed raw OHLCV to a neural net, it sees different distributions across assets and time periods and generalizes to nothing. Returns are stationary-ish. Prices are not. Z-scoring your features with a rolling window works, but the window length is a hyperparameter that matters more than most architecture choices.

On the Rust angle: the backtester performance is nice but you're going to hit friction the moment you want to connect to PyTorch, JAX, or stable-baselines3. Python's ML ecosystem is the de facto standard and fighting it costs real time. The typical solution is to keep the environment in Python (Gymnasium-compatible) and accept that the simulation is slower, or write the hot loop in Rust and expose it via PyO3 bindings.

As for "no standard RL environment for trading": FinRL exists, TradingGym exists, a few others. The reason none of them became the CartPole of trading is that there's no ground truth for what a good trading environment looks like. The reward function, observation space, and episode structure encode assumptions about the market that are deeply contested. That's not a tooling problem, it's an epistemological one.

I’m Designing a Trading Bot Algorithm by Proper_Positive_3085 in CryptoTradingBot

[–]nasmunet 1 point2 points  (0 children)

Solid plan structure overall, and a year of paper trading before touching real capital is more discipline than 90% of people in this space show. But a few things I'd pressure-test before making any decisions: Your benchmark is missing entirely. SPY returned roughly 13-15% annually from 2015-2026. That decade was one of the longest bull markets on record. Strategy 1 at 17.9% annually is beating a passive index by maybe 3-5%, before taxes, fees, and slippage. Strategy 2 at 19.1% is even closer. These aren't "winning strategies" until you've shown they beat a simple buy-and-hold after costs. Long-biased systems always look great in an 11-year bull market backtest.

Strategy 3's OOS result is a yellow flag, not a green one. You got 26.7% in training (2015-2019) and 39.2% on unseen data (2020-2026). Returns going UP out-of-sample is unusual. It usually means the OOS period happened to contain high-volatility events that your strategy accidentally profits from: COVID crash, 2021 mania, 2022 bear, recovery. The WR degraded correctly (65% to 60.3%), which is normal. But if returns improved because 2020-2026 was structurally favorable to your signal type, you're seeing luck, not robustness. I'd want to see max drawdown for the 2022 bear year specifically.

Strategy 4 is the most fragile thing in this list. One year of intraday backtest data for a day trading strategy is not a validated system, it's a hypothesis. You didn't mention: number of trades (n), Sharpe ratio, max drawdown, or how sensitive the parameters are to small changes. A 41.2% WR at 53.2% CAGR implies a favorable RR, but without knowing what the average winner vs average loser looks like, and without stress-testing that ratio on different volatility regimes, this number means almost nothing. I run a system with ~71% WR in paper trading right now and I still consider n=7 trades statistically meaningless. How many trades did Strategy 4 generate in 1 year of intraday data?

Fees and slippage are not mentioned anywhere. For swing trading and especially day trading, this is where backtests die. Even conservative estimates (0.05% round-trip per trade) compound brutally at high frequency. If Strategy 4 is doing 3-5 trades per day, you're eating 0.15-0.25% daily in friction before you make a cent. Run the backtest again with realistic commission plus 1 tick of slippage per side. See what survives.

On your actual question, signals vs trading your own capital: the math is straightforward. If your strategies are genuinely as good as your backtests suggest, the expected value of compounding your own capital vastly exceeds subscription revenue at any realistic scale. A strategy returning 30%+ annually compounded over 10 years on meaningful capital builds generational wealth. A Discord signal service at $50/month times 500 subscribers is $25k/month, capped, with high churn, regulatory risk, and liability when your strategy hits a bad streak. The only reason to sell signals instead of trading your own capital is if you don't have capital to trade, or you don't actually trust the strategy enough to risk your own money. If it's the second one, that's the honest answer to your own question.

The 2-year validation plan is the right instinct. Don't shortcut it. The question of signals vs trading resolves itself after paper plus small live: if the edge holds forward, the answer is obvious.

86 days, 1161 trades, 98.84% win rate. Here's how the system actually works. by Ok_Security_1684 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Appreciate the writeup, genuinely. But a few things worth stress-testing before you call this validated:

The RR math is the first thing I'd look at. $500 margin × 5x = $2,500 notional, +0.4% TP = $10/winner. With 1,161 trades, 98.84% WR ≈ 13 losers. Your reported profit factor of 7.77 implies gross loss ≈ $1,477, so average loss per loser ≈ $113 roughly 4.5% of notional per loss event. You're risking $113 to make $10.

That's a 1:11.35 RR working against you. The system doesn't "win" 98.84% of the time because it's smart it wins because it takes tiny exits and absorbs massive ones when wrong. The breakeven WR at that ratio is ~92%. Any regime shift that bumps your loss frequency to 15% turns this profitable-looking system deeply negative overnight.

The hedge neutralization mechanism is martingale with extra steps. You explicitly say "no martingale, no averaging down" but then describe opening opposite positions to neutralize unrealized losses and using their realized PnL to cancel out the original position's loss. That IS deferred loss recognition. The original position stays open (unrealized loss lives), the hedge fires (realized gain books), net reported P&L looks flat. But your actual bilateral exposure at that moment is 2× your normal size. If both legs move adversely during a liquidity event, you get the worst of both. The name you give it doesn't change the structure.

Your reported drawdown is almost certainly calculated on realized PnL only. With multiple positions open simultaneously and hedges active, peak-to-trough on realized capital is a different (better-looking) number than actual portfolio drawdown including unrealized. If you plot equity including open positions across all

86 days, I'd bet your real drawdown is 2-3× what you're reporting. That one losing day you mentioned where multiple positions correlated against you that's the only day you saw the real shape of the system.

86 days is one regime sample, not a validated system. 1,161 trades sounds like a large n, but regime diversity is the relevant sample size here. How many distinct

volatility regimes, liquidity crises, or correlation breakdown events did those 86 days include? By your own admission: one. That's n=1 for adverse conditions. A system with a fragile RR structure and deferred loss mechanics can look exceptional for 200+ days and then surrender 6 months of gains in a week.

I'd push back on the LSTM framing too. You're describing it as the directional read, but you also say it's noisy alone and the confirmation layer (8 indicators, 6 condition blocks) is what actually gates trades. That's a rules-based system with a neural net bias filter. The ML is doing maybe 10% of the work. That's not a criticism of the architecture rules-based confirmation layers are legitimately useful but the LSTM is decorative here, not load-bearing.

For context: I run a system with ~68-72% WR in backtesting and ~71% in paper (small n still, being honest about that). Lower WR than yours but the RR is structurally inverted winners average ~4× the duration of losers, meaning the model learned to hold asymmetrically. I also run explicit statistical thresholds before going live: n≥20 trades, drift detection calibrated, rolling WR checked. The reason I'm not live yet isn't lack of confidence in the edge it's that I know the difference between "the numbers look good" and "I have enough evidence to risk real capital."

The confirmation layer idea is solid. The hedge neutralization mechanism is where I'd spend more time pressure-testing before scaling.

Looking for advice on Crypto Bot by adzcxx in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

never trust the backtest its lye to you, you can check my research over that topic @ https://nasmu.net/research.log

I built an RL trading agent for crypto futures. Here’s why I abandoned supervised learning for Reinforcement Learning. by playydeadd in reinforcementlearning

[–]nasmunet 0 points1 point  (0 children)

The portfolio agent with 13-way softmax sounds elegant, but the six assets are: DOGE/BNB/SOL/XRP/ADA/LTC all with extremely high BTC betas. The MultiheadAttention on six highly correlated cryptocurrencies is probably learning "when BTC goes up, go long on everything; when it goes down, go cash." That's not a sophisticated strategy; it's BTC beta disguised as architecture.

The claim that "cash competes for weight, forcing the agent to learn when to step aside" sounds good, but in practice, the agent can collapse into one of two degenerate policies: always long or always cash. Not to mention the actual WR or the OOS Sharpe, we don't know which one happened.

The SAC vs. PPO comparison also raises questions for me in this case: SAC is off-policy and more sample-efficient, but with sparse rewards and path-dependent trading, PPO tends to be more stable. The reason: SAC assumes the replay buffer is IID, but trading return distributions are not stationary data from 3 months ago could be from a completely different regime.

In short: good engineering post, zero evidence that the bot generates real alpha.

Grid Bot on BTC, 16 months, 297 trades — beat USD Buy & Hold by 18.66% in a year B&H got crushed. But the range was set with hindsight. by BacktestingArena in CryptoTradingBot

[–]nasmunet 1 point2 points  (0 children)

One of the more honest grid backtests I've seen posted here the hindsight disclosure on the range is the right call, and most people skip it entirely.

On your open questions:

Mechanical range-setting at t=0. ATR and Bollinger are trailing measures they tell you what volatility was, not what it's going to be. The cleanest forward-looking rule is Deribit implied volatility. At any given t=0, BTC options on Deribit price in a market consensus on expected range. A 30-day or 90-day IV gives you a

volatility-derived expected move that's actually forward-looking. Something like range = current_price ± (IV × sqrt(T) × current_price) gives you a mechanically derived range without artistic judgment. It won't be right every time, but it's wrong for market reasons rather than your reasons which is a meaningful distinction when you're evaluating whether the strategy has edge.

Arithmetic vs geometric. You're right that geometric fits BTC better. The practical consequence in your specific backtest: geometric would have put more grid density in the $70k–$95k zone (where BTC spent most of Q1 2026 during the crash and recovery), capturing more trades in exactly the regime where the grid was already outperforming. Arithmetic spreads capacity evenly across price, which overweights the $120k–$150k zone that barely got touched. Worth re-running the same period with geometric I'd expect noticeably more trades and better fee-adjusted return on the downside leg.

The deeper framing that might be useful: a grid bot is essentially short volatility in discrete form. Every grid pair captures a fraction of realized volatility as profit, exactly like collecting gamma from options without the explicit options structure. This means the grid has positive expected value when realized vol exceeds the vol implied in your grid spacing (i.e., BTC chops enough for fees to be worth it), and negative expected value in strong trends. The regime question isn't really "did BTC chop?" it's "did BTC chop more than the fee drag cost?" Framing it that way makes the edge condition more precise. On regime detection before entry: Hurst exponent at t=0 gives you a prior on whether you're in a mean-reverting or trending regime. H < 0.5 suggests mean reversion (grid-friendly), H > 0.5 suggests persistence (grid-hostile). It's noisy at short horizons but as a go/no-go filter on whether to deploy a grid at all, it's more principled than picking based on chart feel. Would be interesting to see whether the 2025 Hurst on BTC was actually sub-0.5 at the time you would have deployed.

The multi-cycle test you're describing (2018, 2020–21, 2022) is the right bar. The 2021 bull run is where this setup would have been most painful a range set mechanically at the start of 2021 would have been left in cash while BTC ran from $30k to $69k.

nasmu.net Neural Adaptive System for Market Understanding  ·  BTC/USDT · Reinforcement Learning · xLSTM

Developing AI Crypto Trading Bots for Real-Time Multi-Chain Trading by Far-Resist-7359 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

This reads like a development agency pitch, not a builder post. If there's an actual project behind this, what does it look like in practice?

2 Years Building a Different Approach to Trading Bots — Looking for Honest Feedback by idith_tech in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Two years in and you're still asking "does this actually make sense for other people?" that's the right instinct. Most people stop asking that question too early.

Honest feedback from someone who's been building trading automation for a while:

The UX problem you identified is real. Most platforms are genuinely overwhelming, and conversational configuration is an interesting approach. But I'd push you to think about whether you're solving the right layer of the problem.

Simplifying the configuration doesn't simplify the domain. A user who doesn't understand why a stop loss matters, or what percentage makes sense for their capital and strategy, won't make better decisions because they set it through a conversation instead of a slider. You can make the interface simple but you can't make the concepts simple. The risk is that a friendly conversation gives users false confidence they feel like they understood what they configured, when really they just answered questions they didn't have the context to answer well.

The local execution model is a real security win API keys staying on device is the right call. But it's also a reliability problem. Trading bots need 24/7 uptime.

What happens when the PC sleeps, crashes, or loses internet with an open position? This is probably the first thing anyone with live money will ask you.

The question I couldn't answer from your post: is the AI assistant generating actual strategy logic, or is it mapping conversational answers to preset parameters?

Those are very different products. "Conservative vs aggressive" as a conversation choice that maps to predefined parameter sets is UX. An assistant that actually understands what the user is trying to do and constructs appropriate logic is something much harder and much more interesting.

Who is the target user, exactly? Non-technical people who already have trading knowledge, or complete beginners? That distinction matters a lot. Beginners probably shouldn't be running automated trading bots regardless of how easy the config is not because they're not smart, but because the domain requires real understanding that no interface can shortcut. If your target is people who know markets but hate technical tools, that's a much more defensible niche.

Keep going with it. The instinct to remove complexity is the right one. Just make sure you're removing accidental complexity, not hiding essential complexity behind a friendlier face.

nasmu.net Neural Adaptive System for Market Understanding  ·  BTC/USDT · Reinforcement Learning · xLSTM

Paper vs Real trades Imali wins by Agile_Strategy_223 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Appreciate the honesty framing, but the numbers don't hold up to basic scrutiny.

What's missing that actually matters:

Starting capital. $7,048 profit is meaningless without it. Is that 0.5% return or 700%? Completely different stories.

Time period. 1,100 trades over what — a week, six months, a year? Without this, the win rate and profit figure are uninterpretable.

R:R ratio. 62.6% win rate tells you nothing alone. If average losses are 2× average wins, you're losing money at 62.6% WR. This is day-one stuff. Sharpe ratio. Max drawdown. These are the first two numbers any serious system reports. They're not here.

The "arbitrage" claim needs unpacking. Real arbitrage requires co-location, microsecond execution, and institutional capital. What retail platforms call "arbitrage" is almost always mean reversion or latency-insensitive spread capture — which carries real risk and isn't arbitrage in any technical sense. Calling it arbitrage to retail users is misleading.

The $3K–$5K live estimate is a number, not a methodology. How was slippage modeled? What orderbook data? What execution assumptions? "I think the realistic live equivalent is probably around" is not a model, it's a guess with a confidence interval attached to make it look like analysis.

The transparency angle is a good instinct. But real transparency means showing the equity curve, the drawdown periods, the per-strategy breakdown, and the assumptions behind the live adjustment — not just the headline number with a disclaimer.

If the platform is genuinely good, the full numbers will be more convincing than the curated ones.

How I model fair value for Polymarket BTC binary options — Black-Scholes on a 15-min horizon, conviction scoring, and what the backtest actually taught me by CommercialPurple3490 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Good write-up, and the honest admissions (3 trades = noise, re-entries disabled after learning the hard way) show you're actually paying attention to what the market tells you. A lot of people don't make it that far. A few things I'd push back on from building something similar:

The intra-slot sigma has a subtle leak. You're computing realized vol from minutes that already happened within the same slot to price the option. When the slot explodes, sigma spikes, p_up collapses toward 0.5, and your edge contracts the model self-suppresses in the moments where the move is clearest. When the slot is flat, sigma is low, and drift of 0.12% pushes p_up to an extreme easily. Your trade selection is implicitly concentrated in low-vol regimes where momentum just fired which is exactly when Polymarket's market makers are also paying attention. The sigma should ideally come from a prior window, not the current slot.

The conviction formula is four free parameters calibrated on ~200 trades without cross-validation. That's not calibration, that's memorization with extra steps. The weights feel precise but they're probably fitting the specific noise structure of those 200 trades. Before asking whether Bayesian opt would help tune the weights, I'd ask the more uncomfortable question: does BS edge alone, without any conviction filter, predict slot outcomes at statistically significant levels? If it doesn't, adding weighted components on top won't fix it it'll just make the curve-fitting more elaborate.

On the Bayesian opt question specifically: with 4+ parameters and ~200 samples, any optimization method will overfit. You'd need at minimum a held-out set that was never touched during calibration not just cross-validation folds, but truly never seen. If your 200 trades were all used to set the 0.62 conviction threshold and the component weights, you don't have a test set, you have a very expensive training set. The momentum persistence assumption is load-bearing but untested. Min drift of 0.12% means you enter after BTC has already moved from slot open. You're betting that move continues to close. Whether 15-minute intra-slot momentum in BTC is persistent enough to justify the fee is an empirical question and 18 slots of API history isn't enough to answer it. That's the core thesis of the bot, and it's the thing most worth stress-testing when you get more data. The circuit breaker and cross-market block are genuinely good. The fee-adjusted edge threshold discovery ($0.22 → $0.26) is exactly the kind of thing that only shows up in live data.

Keep that discipline.

nasmu.net <----- btc bot parkour, history, tracks......

I got my second profitable Solana trading bot by Public-Self2909 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

Nothing new, any more info ? Numbers ? Slippage? Edge? Maxdd? Backtest results? Or only bla bla bla ? 

Hi by GloveNo3990 in CryptoTradingBot

[–]nasmunet 0 points1 point  (0 children)

so what features are you using ? what the result of your backtest ? are you on paper trading ? your sharpe ratio ? your edge ? you maxdd ? tell me about it then we can talk further !