r/algorithmictrading • • May 18 '26

Backtest Aggregated Momentum (20/20)

Thumbnail
gallery
37 Upvotes

Here's yet another EOD strategy I've been playing around with lately. It is akin to momentum ensemble and aggregates the scores of a few fixed momentum kernels. It is more or less parameter-less (the only parm is the exposure level, which is heavily quantized). Uses the same S&P500 basket as my other backtests. Like always, executions are MOC, nothing exotic.

The equity curve is a 26-year GA optimization backtest (CAGR/maxDD = 20%/20%) and the CAGR/MaxDD histograms are from 5000 26yr MC sims of the winning chromosome. Open to comments and constructive criticism.


r/algorithmictrading • • May 08 '26

Educational Unpopular opinion? To succeed in algo trading, you have to be a trader first and a coder second.

37 Upvotes

When I see the rate of failure in the algo trading community I wonder how many people are actual traders themselves? I see people complaining about not being able to build a single bot that can be profitable for more than "just a year or two" when there is simply no real trader in the world who trades the exact same way all the time! They all adapt their strategy to the market.

To "make it" in algo trading I believe you have to be a trader first with robust knowledge of the market you trade, and a developer/programmer second. Unfortunately I see too many people who are inexperienced with the markets who think their background in programming is enough to help them build profitable trading bots.

All profitable algo traders I know are seasoned manual traders first who transition to algo trading and then they usually only use scripts/algos to help them execute in a semi-automated fashion. They all like to keep some level of discretion, monitoring market sentiment, bond yields, news of the day i.e. stuff that's not so simple to code into a bot, then when it's time to execute they let the machine do its thing.

Algo trading isn't a magic wand that lets you bypass the hard work of acquiring real screen time and market knowledge. That has to be your foundation. It's like a weekend golfer buying a set of Tour-level clubs hoping it will magically fix his terrible swing. The clubs might be state-of-the-art, but if you don't understand the fundamental mechanics of the game you're still going to slice the ball into the woods on every drive!


r/algorithmictrading • • Dec 05 '25

Strategy VEI - Volatility Expansion Index ( Source Code )

Thumbnail
gallery
35 Upvotes

Guide to the Volatility Expansion Index (VEI)

The Stability Filter Every Trader Should Use

Source Code 👇

//@version=5

indicator("VEI - Volatility Expansion Index)", overlay=false)

// Settings

shortATR = input.int(10, "ATR Short Length")

longATR = input.int(50, "ATR Long Length")

threshold = input.float(1.2, "Expansion Threshold")

// ATR calculations

atr_short = ta.atr(shortATR)

atr_long = ta.atr(longATR)

// VEI calculation

vei = atr_short / atr_long

// Plot VEI

plot(vei, color=color.new(color.blue, 0), linewidth=2, title="VEI")

// Plot threshold line

hline(threshold, "VEI Threshold", color=color.red)

// Simple color change

bgcolor(vei > threshold ? color.new(color.red, 85) : na)

Most traders obsess over entries, patterns, and direction. They look for the next perfect breakout or the cleanest trend.

But before any of that matters, there is a more fundamental question that determines whether your strategy has a fighting chance:

“Is the market stable enough for your strategy to work right now?”

A stable environment produces smooth trends and clean pullbacks.An unstable one creates whipsaws, volatility spikes, failed breakouts, and unexpected reversals.

The Volatility Expansion Index (VEI) helps you identify these environments instantly. It doesn’t predict the next move it tells you whether the market is in a condition where your strategy can perform well.

What is the Volatility Expansion Index (VEI)?

The Volatility Expansion Index (VEI) is a simple but powerful metric that reveals the character of current market volatility.

It compares fast volatility to slow volatility:

VEI = ATR(short) / ATR(long)

Where:

  • ATR(short) = recent volatility (fast reactions, current conditions)

  • ATR(long) = baseline volatility (the market’s “normal state”)

A high ATR alone doesn’t tell you if volatility is normal or abnormal.VEI shows whether volatility is expanding beyond its historical baseline, which is a critical variable for strategy performance.

How to Read the VEI: Three Market States

VEI makes market conditions ridiculously simple to read. It gives you three volatility regimes, each with direct implications for your strategy:

VEI Value < 1

Market Condition is Normal & Stable

Market behaving typically. Clean structure. Better strategy performance.

VEI > 1.2

Market Condition is Unstable & Expanding

Volatility spike. Wicks, fakeouts, broken structure. Be cautious.

VEI < 1 and Decreasing

Controlled & Structured

Calm, orderly volatility. Pullbacks respected, trends smoother.

Think of VEI as a weather report for the market.

 It doesn’t tell you the direction but it does tell you if the conditions are safe.

VEI’s Purpose: A Filter, Not a Signal

VEI is not designed to tell you when to enter.t is designed to tell you whether you should enter at all. its job is classification, not prediction.

What VEI IS

  • A market stability filter

  • A classifier for stable vs unstable regimes

  • A risk-management tool

  • A way to know when conditions are favorable for your strategy

What VEI IS NOT

  • A buy/sell signal

  • A directional tool

  • A price prediction system

  • A timing indicator

Think of VEI as the gatekeeper of your strategy. If volatility is chaotic, even the best entry signal becomes unreliable.

The Best Starting Settings for VEI

A clean, proven configuration for VEI across Forex, Crypto, and Indices:]

  • ATR Short: 10

  • ATR Long: 50

This combination captures:

Recent market behavior (ATR 10),Long-term volatility baseline (ATR 50).A reliable contrast between fast and slow volatility

These settings are balanced, universal, and have shown consistent behavior across trending and ranging markets.

Trade With More Confidence

The Volatility Expansion Index is the missing context filter for many traders. By identifying volatility regimes, VEI helps you:

  • Trade only when your strategy has an edge

  • Avoid unstable, random, dangerous market conditions

  • Stay aligned with environments your strategy thrives in

  • Reduce unnecessary losses from volatility spikes

When you understand volatility regime shifts, you trade with greater clarity and precision.

VEI doesn’t replace your strategy, it strengthens it.t ensures you operate in the environment your system is built for.


r/algorithmictrading • • Jun 06 '21

Algo trading platform

34 Upvotes

We are building an algo trading platform that would allow retail traders to build, backtest, paper-trade and live trade.

Below are some key features and I'm looking for feedback. If you are interested to share your ideas, chat about your experience or even want to beta test it please let me know.

- Low code creation of an algo

- US Equity

- Technical and fundamental analysis to begin with (want to add news later)

- Integration with popular brokers for live trading

- Stock screeners/scanners

- Backtesting for ~15y

- Paper trading

As a full disclosure I must say that I'm one of the founders of the company.

We are near launch and should be live this summer: http://breakingequity.com/

[UPDATE]: It's live!


r/algorithmictrading • • Apr 18 '26

Backtest Allocating live capital. Here is the 3-year OOS data and Monte Carlo stress test for a 31% win-rate system.

Thumbnail
gallery
33 Upvotes

Preparing to allocate live capital to a BTC/USDT volatility model. I'm putting the data up for a final tear-down before going live.

Here is the raw data from the 3-year blind Out-of-Sample test (April 2023 – April 2026):

The Statistical Edge:

  • Total Trades: 545

  • CAGR: 76.79% (Sharpe: 1.89 | Sortino: 5.32)

  • Average RRR: 1 : 4.34

  • Directional Split: +135R on Longs | +131R on Shorts. Purely agnostic.

The Execution Reality:

  • Win Rate: 31.01%

  • Max Historical Losing Streak: 18 Trades

The end-of-year CAGR looks great on a tear sheet, but executing a 31% win rate is psychological warfare. An 18-trade drawdown at a standard 1% or 2% risk is exactly where most people capitulate and override their own system.

To make this tradeable, the position sizing is capped via a Fixed Fractional model at a strict 0.5% risk per trade. At that allocation, a 1,000-iteration Monte Carlo simulation projects the severe drawdown boundary (bottom 5th percentile) at just -11.76%, with Risk of Ruin sitting at 0.10%.

I've attached the tear sheet and projection chart.

To validate the strategy's resilience against sequence-of-returns risk, a 1,000-iteration Monte Carlo simulation was executed. The engine resampled the 545 historical trades to project the expected mathematical pathways for the upcoming 12 months (approx. 180 trades), assuming the institutional 0.5% risk parameter.

Projected Capital Trajectories:

  • Median Expected Return: +52.04%

  • Optimistic Pathway (95th Percentile): +99.62%

  • Pessimistic Pathway (5th Percentile): +17.44%

Projected Drawdown & Ruin Probabilities:

  • Expected Maximum Drawdown: -6.78%

  • Severe Drawdown Limit (Worst 5%): -11.76%

  • Probability of Profitability: 100.00%

  • Risk of Ruin (>20% Drawdown): 0.10%

Analyst Note on Stress Testing: The simulation confirms that even in the bottom 5th percentile of probabilistic outcomes—where the system encounters sustained, severe historical losing streaks—the mathematical drift of the 4.34 RRR pulls the portfolio to a +17.44% annual gain. The Risk of Ruin is statistically negligible at 0.10%.


r/algorithmictrading • • Aug 13 '24

Algorithmic Trading Podcasts you don't want to miss!

33 Upvotes

Podcasts have been my favourite source of inspiration when learning algorithmic trading.
Here are my TOP 5!

  1. Marsten Parker - The Purely Systematic Wizard Trader
    Chat With Traders: Ep 281 https://open.spotify.com/episode/5vrtv35dSPdfloUA68Ol4e?si=UYxGgYhJSge2-IplKajhtQ

  2. 3 Biggest Lessons from Chart Trader to Algo Hedge Fund Manager
    Better System Trader: Ep 219 https://open.spotify.com/episode/38GC1RLG1oFhka0IxCdgnB?si=1eTBeE7GRAatHsXNaUY-Xg

  3. Is Trading Fewer Markets Actually Better? ft. Richard Liddle & Gareth Abbot
    Top Traders Unplugged: Open Interest Ep 05 https://open.spotify.com/episode/1yU52e4WfSruvSTb4gjlG7?si=Ddw012hUTQ2kpJOAWkkP2Q

  4. How to Beat the Benchmarks ft. Richard Brennan
    Top Traders Unplugged: Systematic Investor Ep 283 https://open.spotify.com/episode/0M4g7QIjkSgOC0lqt83a07?si=-0Tb4bplTmeySbfp1lESWg

  5. Algorithmic Crypto Trading - Pavel Kycek
    Better System Trader: Ep 225 https://open.spotify.com/episode/22wlHSYNrgxHJImGpVlm9X?si=jjkQ11qETEeKKO9dwnsykg


r/algorithmictrading • • Jan 21 '25

My verified results + AMA

32 Upvotes

I’ve been algo trading since 2021. Here’s the latest iteration of my portfolio. I run over 50 automated strategies on a variety of markets including fx, gold, indices, cryptos, and oil.

Currently in talks with some investors to scale this up.

Ask me anything and I’d be happy to share my two cents.

Edit: launched my Strategy Quant X course at https://www.triviumsystems.co


r/algorithmictrading • • Sep 01 '26

Backtest Profitable SPY ORB strategy — looking for fresh eyes on optimization & 0DTE translation

Thumbnail
gallery
31 Upvotes

Hello my fellow Traders, I’ve been developing and backtesting a systematic ORB strategy on SPY and have gotten it to the point where I think there’s enough evidence of an underlying edge to warrant taking it further. I’d love some fresh eyes from people experienced with ORBs, systematic trading, or 0DTE options.

The strategy uses a defined opening range, breakout confirmation(ORB) , time-based entry restrictions, range filtering and rule-based exits. It trades both directions, is limited to one trade per session, and I’ve been optimizing the major components individually rather than throwing every parameter into an optimizer at once.

I’m using TradeStation/EasyLanguage and evaluating more than just net profit — profit factor, expectancy, drawdown, trade count, long/short performance and parameter stability all matter to me. The attached SPY backtest covers 2020–2026 with 576 trades, a 54.2% win rate and 1.56 PF. The small nominal P&L is simply due to the underlying test sizing; I’m interested in the edge/robustness, not the dollar return shown.

My biggest challenge is the next step: I ultimately want to execute this through SPY 0DTE options. Obviously an edge measured on SPY won’t translate 1:1 because of strike selection, delta/gamma, IV, spreads and decay.
I know historical intraday options data is eventually the proper way to test that. Cboe data is available, but the dataset I’ve looked at is around $2,200, so I’d like to make sure the underlying model is sufficiently robust before making that investment.

For anyone who has worked through something similar: at what point would you stop developing the underlying model and move to options-level testing? And how would you approach validating that an underlying ORB edge actually survives the transition to 0DTE?

I’m also very interested in hearing from other ORB/systematic traders about what looked promising in-sample but failed during walk-forward/OOS testing, or anything you think I should be testing that I may have overlooked.

Not looking for anyone’s proprietary strategy or asking someone to build mine — mainly looking for criticism, ideas, resources and experienced perspectives. Happy to discuss more specifics where they’re relevant in the comments and I appreciate you reading this far!


r/algorithmictrading • • Oct 20 '26

Backtest MNQ momentum system Backtest Result

Post image
29 Upvotes

I'll be as open about this as I can. The one thing I keep is the entry trigger.

What it is

A momentum system on MNQ, 5-minute bars, fully automated on NinjaTrader. It has no opinion about direction. When price does something decisive, it goes with it.

How it runs

  • Signals are read at the close of each 5-minute bar, and the entry goes in at market right after.

  • One contract, one position at a time. No adding, no averaging down, no martingale, no grid.

  • Every trade gets a hard stop the moment it fills, the same distance every time.

  • Once a trade is up by that same distance, the stop starts trailing tight behind the best price. There's no profit target.

  • A decisive move the other way closes the trade and reverses it.

  • It trades the overnight session too. It goes flat at 16:45 New York and takes nothing new until the 18:00 reopen.

Over the last year 45% of trades ended on the trailing stop, 37% on the stop loss, 15% were reversed by an opposite signal and 2% closed at the daily flatten.

The numbers

TradingView backtest, the last 12 months to 20 Oct 2026, 1 MNQ, $0.50 a side commission.

  • 4,907 trades, about 19 a day. 49% winners; the average winner was $80 and the average loser $69.

  • Net +$20,362.

  • Max drawdown $2,120. The longest stretch without a new high was 51 days, mid-April to early June.

  • Worst day −$703, best day +$1,018. The longest losing run was 5 days in a row.

MonthP&L
Oct 2025 (from the 20th)−$86
Nov+$1,242
Dec+$847
Jan 2026+$1,991
Feb+$1,218
Mar+$2,448
Apr+$1,661
May+$544
Jun−$768
Jul+$2,985
Aug+$2,937
Sep+$4,306
Oct (to the 20th)+$1,036

What I'm not sharing is the entry trigger and the exact settings. Ask me about anything else.


r/algorithmictrading • • Oct 12 '26

Educational Lessons from 242 strategies

Post image
29 Upvotes

I reviewed 242 strategies across 37,476 completed simulated trades from September 21–October 9, 2026.

Three lessons stand out:

  1. Use time of day as a strategy filter. A setup at 9:35 a.m. can tell a different story at 12:35 p.m.

  2. Read the broader market trend. It can support a trade or highlight unusual strength or weakness in an individual ticker. Follow the trend.

  3. Watch the data alongside the headlines. Price, volume, and momentum show how the market is responding.

A few numbers surprised me:

- Opening calls showed strength. Across strategies, calls entered from 9:30–10:00 ET averaged +4.16% net, with 68.9% wins across 2,456 trades.

- Failed breakdowns has a good lunch hour. ORB Failed Breakdown calls won 69.5% of 174 trades entered between noon and 1 p.m. ET. Average net return: +3.53%.

- A higher win rate does not guarantee a higher average return. GEX DEX Dip calls won 67.2% of 137 noon entries, but averaged +3.80% net—slightly ahead of Failed Breakdown.

- Winning most trades wasn’t enough. Across the full dataset, 59.8% of trades won, yet average net return was −0.48%. Average winners gained 13.92%, while average losers lost 21.92%.

My takeaway: use market direction together with momentum, volume, and timing. Trading against the trend needs a clear reason, and every setup needs a defined exit.


r/algorithmictrading • • Aug 29 '26

Backtest I finally froze my first systematic NQ futures strategy after a full robustness validation

Post image
29 Upvotes

After months of building and testing a systematic NQ futures strategy, I finally reached the point where I'm comfortable freezing the research.

I called the strategy S2R.

The important part for me isn't that the backtest is profitable.

It's that I tried to attack the result from multiple directions before considering it research-complete.

Frozen model

• MAE threshold: 0.70R

• Recovery threshold: +0.20R

• Recovery deadline: 6 bars

No parameter optimization was performed after freezing these values.

Holdout OOS

The final holdout consists of 217 trades:

• Total: +34.3452R

• Mean: +0.1583R/trade

• Win rate: 53.92%

• Profit Factor: 1.3815

• Max drawdown: -7.76R

But I didn't want to stop there.

Robustness testing

I ran:

  1. Monte Carlo / Bootstrap

Tested the distribution of possible outcomes and drawdowns.

2. Time-aware block bootstrap

Blocks of 5, 10 and 20 trades were tested to avoid assuming that every trade is independent.

3. OOS window stability

I removed each OOS window individually.

The strategy remained positive in 11/11 leave-one-window-out tests.

Worst case:

+20.05R

4. Year stability

OOS performance:

2024: +13.68R

2025: +10.97R

2026: +9.69R

So 3/3 OOS years were positive.

5. Parameter perturbation

I tested 125 nearby combinations of MAE threshold, recovery threshold and recovery deadline.

125/125 were positive.

125/125 had PF > 1.

Final result

The complete research gate passed.

At this point I'm deliberately not optimizing S2R anymore.

The research parameters are frozen.

The next phase is engineering:

I'm going to rebuild the strategy as a modular Python implementation and verify that the modular implementation reproduces the frozen research results exactly.

I'm documenting the project in Github

I'm especially interested in feedback on the validation methodology rather than just the headline returns.

What would you test next before considering a systematic strategy ready for live/paper deployment?


r/algorithmictrading • • Jun 25 '26

Backtest 5 year backtest TSLA strategy

Thumbnail
gallery
27 Upvotes

I’ve been developing an intraday breakout strategy on Tesla for months. What started as a simple range breakout system gradually evolved through lots of iterations — adding filters, refining exits, and eventually running a proper walk-forward validation. It’s been running live on my real account since March 11, 2026.
Sharing the full results and methodology here because I think the validation process is worth discussing. Most backtest posts skip this part entirely.

The strategy in plain terms:
The system identifies a price range using the high and low of the previous 4 candles on the 5-minute chart. When price breaks out of that range with enough momentum, an entry is triggered — but only if four filters all agree:
• ADX: confirms the breakout is happening in a trending environment
• Minimum range size (ATR-based): rejects setups where the range is too compressed
• Candle strength: evaluates the size and close position of the breakout candle
• RSI on higher timeframe: avoids entries in overbought/oversold conditions on the higher timeframe
This combination addresses the main failure modes of breakout trading: false breaks, low-momentum moves, and counter-trend entries. The result is a win rate significantly above the 45–55% typical of unfiltered breakout systems.
Exits use a layered approach: fixed TP at 2.75%, EMA trailing stop, no-progress exit, and a no follow-through exit if price returns into the range. In the last hour of the session, the trailing tightens aggressively to protect intraday gains.
~150 trades per year, both long and short, NYSE RTH only.

Backtest results:
(Jan 2021 – Jun 2026, $100k fixed capital, $1/order commission + 5 ticks slippage, no compounding)
• Net profit: +$378,906 (+378.91%)
• CAGR: 33.37%
• Max drawdown: 6.45% — TSLA itself drew down -56% in this period
• Calmar Ratio: 5.17
• Profit Factor: 2.181
• Sortino Ratio: 2.954
• Sharpe Ratio: 0.693
• Win Rate: 71.15% across 825 trades
• 57 of 66 months profitable (86%)
• Zero losing years

Capital is fixed throughout — no compounding.
With 70% equity reinvestment the numbers look very different:
• Net profit: +$1,242,892 (+1,242.89%)
• CAGR: 61.33%
• Max drawdown: 9.52%
• Calmar Ratio: 6.43
• Profit Factor: 2.168
• Sortino Ratio: 2.853
• Sharpe Ratio: 0.887

Walk-forward validation — the part I want to focus on
I ran three WFA iterations to test whether the edge holds on unseen data:

|Iteration| In-Sample | OOS | Profit factor |
|1 |2021–2023 | 2024 | 1.714 |
|2 |2021–2024 | 2025 | 2.878 |
|3 |2021–2025 | 2026 | 2.106 |

All three OOS periods made money. Two of three had a PF above 2.0 out-of-sample.
Iteration 1 is the weakest — H1 2024 was the most directionless period TSLA had in the entire dataset. A breakout system underperforming in a low-momentum regime is expected behavior, not a strategy failure. It recovered as soon as volatility returned.

Happy to discuss the methodology, the exit logic, the walk-forward process, or anything else in the comments.


r/algorithmictrading • • Jun 21 '26

Backtest Is quantower backtest accurate?

Post image
27 Upvotes

Hi everyone,

I recently switched from NinjaTrader 8 to Quantower. To test the waters, I migrated a strategy that was modestly profitable on NT8. I kept the exact same logic, risk management, and parameters (only 5 variables).

The strategy was only trained on the NQ 06-26 (trained on NT8, i didnt even get to train it on quantower since the fisrt time i backtested it to see if it worked i got this results) but it shows the exact same performance even from 2020 and earlier

However, the backtest results in Quantower are suddenly sky-high and unrealistic.

The strategy uses limit orders and custom volume profile calculations. Since I had to code my own volume profile system on NT8, I suspect there is a massive structural difference in how both platforms handle historical data, tick interpolation, or limit order fills (e.g., "Touch = Fill" logic vs. real queue priority).

I reviewed the C# code with some LLMs and the logic seems clean, meaning the discrepancy most likely lies in how the backtest engine itself operates.

For those experienced with both SDKs: Is Quantowers backtester known for being overly generous with limit fills or handling historical volume data differently than NT8? Am I looking at a platform illusion or a real engine optimization?

I personally dont even know if i have a real edge or its all an error by the backtest tool


r/algorithmictrading • • Nov 29 '21

Backtest Winners keep winning - a 2021 backtest NSFW

27 Upvotes

There is a famous saying "Winners keep winning" which means that stocks that do well tend to keep doing well...

I have backtested the idea using the setup below for 2021.

  • Each day I'm looking for stocks which

    • belong to NASDAQ 100

    • have been up 3% or more on a prior day

    • are up in the morning (price above yesterday's close)

  • Enter (criteria to open a position)

    • Wait for 9:40 (market is open for 10min)

    • Stock price keeps going up

    • Buy only one stock for the day

    • If there are multiple candidates buy the one with highest relative volume comparing to the average market volume so far (10min average volume)

  • Initial capital $10,000

    • Gain is reinvested the next day

    • Loss reducing the buying power the next day

  • Exit (criteria to close a position)

    • End of the same day or by loss at 0.5% from fill price

Results: Cumulative GAIN 75.29% | Max Draw Down -5.36%

Disclaimer: all calculations made using BreakingEquity.com


r/algorithmictrading • • Apr 03 '26

Question This is enough for going live trading, or? From 10k$ to 1200k$ in 5 years.

Thumbnail
gallery
26 Upvotes

I used one of my public indicators, ZZ Range, with default settings and plugged it into my backtesting script. Its long-term performance looks similar to its short-term results. So… is it time to start (paper) trading?

Please roast my backtest — I’m looking for doubts, criticism, and any hints on what I might be missing.


r/algorithmictrading • • Jan 06 '26

Question If you had to relearn algo trading today, how would you do it?

26 Upvotes

In what order would you relearn things? Why? How?


r/algorithmictrading • • Apr 09 '26

Backtest Did I cook?

Thumbnail
gallery
25 Upvotes

For the past few weeks I’ve been developing my own EA to use on ninja trader. I pretty much just coded my exact strategy and the results were pretty good. I want to know if the numbers are realistic or what I can expect.


r/algorithmictrading • • Sep 29 '25

Strategy How can I improve my strategy?

Post image
25 Upvotes

Hi guys. I've recently entered a competition with my team called the Global Wharton Investment Competition in which we are tasked with growing our clients portfolio using a strategy that we create. In order to increase our chances of winnings I have researched some quantitative financial models such as the black-scholes model and I have a rough idea of what the strategy will be like. The main strategy for the competition would be to use option chains for varying assets with the expedition date set at different dates (day, week, month from current date). Using the implied volatilities of the options i would calculate the discrete implied volatilities for every available strike price at a single expiration. I would then smooth the function to create a continuous curve. I would then convert the implied volatility curve back into an option price curve and use the Breeden-Litzenberg formula to create a risk neutral probability density function. I will use mostly use Ai to code the graphs and other stuff. The graph will look similar to the photo posted. I will then base my decision on buying the stock if the probability of the price increasing is high. This is just the base of my strategy. Any advice on how I can refine my strategy and what resources I can use to learn as im relatively new to investing?


r/algorithmictrading • • Jan 28 '21

Robinhood claims it has a scheduled maintenance for Dogecoin. NEVER HAVE I EVER SEEN ANY scheduled maintenance for any stocks. ROBINHOOD Still on they BullShit. I may have to take all of my money out and put it in WeBull

Post image
25 Upvotes

r/algorithmictrading • • Mar 07 '26

Backtest [Backtest] +541% in 2 years on 4H – Breakdown of my "TPI" (Trend Precision Invest) Strategy

24 Upvotes

Hi everyone!

After months of tweaking Pine Script to filter out market noise, I wanted to share the results of a strategy I’ve been developing. This isn't a "get rich quick" moon-shot; it’s a pure trend-following system designed for survival and long-term consistency.

📊 The Numbers (Backtest 2024-2026 / 4H Timeframe)

* Net Profit: +541.04% (vs. +224% for Buy & Hold)

* Profit Factor: 2.445 (For every $1 risked, it returns $2.44)

* Win Rate: 38.60% (Low, but balanced by a massive RR ratio)

* Avg Win / Avg Loss Ratio: 3.89

* Max Drawdown: 22.40% (Intra-bar)

* Commission Simulated: 0.08% per order (Real-world spot fees)

⚙️ The Concept: "Trend Precision Invest" (TPI)

The core philosophy is: Never chase the noise. The strategy waits for a confirmed volatility breakout backed by three layers of filters before putting a single dollar on the table.

  1. The High-Conviction Entry Setup

* The Impulse: A breakout of the Donchian Channel (40 periods). We only buy if we hit a recent 40-bar high.

* The Trend Filter: Price must be above the 200 EMA. No longing in a macro Bear Market.

* The Momentum: RSI > 55. We want strength, not a "weak" breakout.

* The Shield: An ATR volatility filter blocks entries if the market is too frantic (>5%), preventing "FOMO buying" at local peaks.

2. Risk Management (Smart Leverage)

This is where the strategy adapts to market conditions:

* Base Trade: Standard position size (e.g., $300).

* "Premium" Trade (x1.5): If the 50 EMA is above the 200 EMA and volatility is low, the algorithm increases the position size. We capitalize heavily on the "cleanest" setups.

3. The Exit Strategy (Dynamic Management)

We never cap our gains with a fixed Take Profit.

* Trailing Stop: We use the lower band of the Donchian Channel (20 periods). We let the profit run as long as the trend holds.

* Momentum Exit: If the RSI drops below 40, we close the position. We’d rather exit a bit early than give all the profits back to the market during a reversal.

💡 Key Lessons Learned

The hardest part isn't finding the entry; it's managing commissions. By moving from the 1H to the 4H timeframe, I reduced fees by 70% and turned a losing strategy into a machine that consistently outperforms the market.

I’d love to hear your thoughts! Do you guys use Donchian for exits, or do you prefer fixed trailing stops based on ATR?


r/algorithmictrading • • Aug 27 '25

Backtest Strategy: Momentum + Dynamic Hedge (21/21)

Post image
24 Upvotes

Here's a basic monthly stock momentum strategy that incorporates a dynamic bond hedge to smooth things out. The strategy was optimized using GA(1000+1000) with MC sampling. The strategy returned 21/21 (CAGR/MaxDD) in a 25yr quasi out of sample back test. I only ran the optimizations for about an hour and this was the best chromosome after >4M sims, so its possible the strategy could perform better. The results are subject to survivorship bias so live results will likely under-perform.


r/algorithmictrading • • Oct 11 '26

Backtest Strategy Backtest

Thumbnail
gallery
22 Upvotes

I am writing this post because I have been unprofitable for 1 year now, however at the start of august I pivoted from penny stocks to QQQ options and developed a strategy that seems to do well. I am writing to ask if this backtest data is promising or if I am not backtesting correctly.

The strategy is using BMP, VFI, TTM squeeze, EMA stack and Swamilaguerre trend. Basically it is a momentum based model. This is on underlying while my strategy is options based but in my forward testing it has been promising with options at around .35-.45 delta buying them at around .50 a share. Any advice from people that use similar indicators to trade options on how to structure my contracts would be much appreciated

The problem is that I am not able to automate my strategy because I dont know much about automation. On top of that I have also been trying to use gamma levels and gamma regimes to add a discretionary level to my trading but it seems to do more harm than good because it just draws me away from explicitly following my strategy.


r/algorithmictrading • • Feb 05 '26

Backtest Improvements on the Strategy and the Framework

Thumbnail
gallery
22 Upvotes

Hey guys. Here's an update on my previous post. I read every comments and thanks for helping me out with your advice and thoughts.

So some people were worried about the strategy itself and the results. The strategy is indeed awful and shouldn't be traded live. But i've made some changes to improve it.

  1. I reduced the trading capital from $10k to $3k, which is what I intend to start algotrading with. I still left the commission and spread as it was. So the framework takes spread into account. My live broker doesn't charge commissions unless we trade with lots >= 1.0, so I left commission as null.

  2. I reduced the risk-per-trade from 2% to 1% of the account's equity.

  3. The issue with the previous strategy and why it had a very bad drawdown of -67% was because the strategy was using a fixed stop-loss of 50 pips and no take-profit, which is easily triggered by a volatile market such as Gold. So I decided to set the stop-loss at the slower SMA when there is a signal, and I set the strategy to use a risk-reward of 1:3.

  4. Finally I made the strategy trade on only London and New York session. These changes expecially the stop-loss and adding take-profits significantly improved the strategy's sharpe ratio, total return, profit factor, win rate, and it significantly reduced the drawdown.

Like I said in the previous post, I'm not too focused on the strategy side of algotrading for now. I'm still working on the framework that lets me develop, test, and run strategies live.

Now on the framework & dashboard side, I've added colour coding to the UI. So a Sharpe ratio of 1.15 is decent but not good enough, a max drawdown of -12.49 is very good, a win rate of 32.3% is good but not good enough, and a profit factor of 1.27 is good but not good enough. We should aim for 1.5 or more. Ive also added a monthly breakdown so that you can see the metrics and the trades for that month.

Finally, I added a little improvement to the strategy class. You can make them give reasons why they took a trade and their confidence score.


r/algorithmictrading • • Jun 07 '21

Blog: trading myths/believes busted

22 Upvotes

I wanted to start a new blog where I would pickup popular believes, turn them into a backtest and publish the results with explanation.

An example would be

"It's profitable to buy stocks on the day of IPO whenever they first appear and sell EOD the same day"

or "You cannot make an algo based on a single indicator profitable for 2+ years"

or "If you have an algo that is profitable just start trading option off the same signals and your returns would go thru the roof"

Please let me know know what you think.