r/algorithmictrading • • Jun 04 '26

Educational How to know if your trading edge is real or just overfit: my 3-step live test

13 Upvotes

TLDR: A trading strategy has a real edge when the rules are fully systematic, the backtest was conducted without hindsight bias or overfitting, has a large enough sample size to be reliable, and live trades still match the backtest after real transaction costs.

What is the first thing you test?

The first thing to test is whether the strategy is actually defined well enough to backtest. A system only means something if the rules are 100% systematic. If the setup depends on discretionary judgment, the backtest is already unreliable.

You cannot say things like:

“If the volume is bad I don't trade”

What does “bad” mean? How can that be quantified? The rules need to be written in a way that removes all your guessing and gut feelings.

Once your rules are defined, you can test it on past data and see if the idea has the potential for edge at all.

How many trades do you actually need?

More trades do not automatically prove that there is an edge, but they do make the backtest result more reliable. There is no magic number for what’s enough, but here is a rough guideline:

Number of tradesReliabilityWhat it usually tells you
30-50~50%Coin flip, ignore it
100~70-75%First hint
200~80-85%Early signal forming
300-500~85-90%Worth taking seriously
500-1000~90-93%Confident enough to trade
1000+~93-95%+Signal you can rely on

These percentages are just one part of validating your backtest. They're the foundation for how much you can trust every other metric you analyze after. The numbers track how sampling error shrinks with √n. More trades tighten the estimate, they don't prove an edge on their own.

My 3-step validation process

Step 1: Backtest the exact rules in the past

The first thing I work on is defining the strategy well enough to backtest. A system only means something if the rules are 100% systematic and have all discretion removed.

Once your rules are set, I test them on historical data to see if my idea had edge in the past. At this stage, the goal is not to optimize anything or improve performance. The goal is simply to answer one question:

does this work under objective, repeatable conditions?

If the answer is yes, then the system moves forward into Step 2.

Step 2: Validate it with real trades

Once the backtest is completed, I validate it with forward testing. Real money on the line, real spreads, and real transaction costs.

Start small.

Even $1 per trade is perfectly fine. The goal is not to make money. The goal is to prove the concept works in live conditions with fees included.

This is where trading psychology matters. If the defined rules are not followed exactly, the live sample is contaminated. You are not testing the system anymore. You are testing your gut feeling and emotions.

Step 3: Compare live results to backtest results

The final step is to compare the live results to the backtest.

  • Did the strategy actually continue to be profitable?

  • How similar were the live results to the backtest?

  • Did the EV distribution stay in the same percentiles?

  • Did the trade frequency stay in the same percentiles?

  • Did the losing streak distributions stay in the same percentiles?

If they don’t match, the system is not instantly garbage. Natural variance can happen, but the results should be monitored across multiple regimes to determine whether the edge still exists or if the market has changed.

So what actually proves an edge?

A real edge is confirmed when the backtest, validation and live equity curve all follow the same distribution.

For my personal system MCT, that proof is very clean. My backtest used 979 trades over 34 months from 2023 to 2025 and produced +303.76R, +0.31R EV per trade, a 37% win rate, average win of +2.24R, average loss of -0.84R, Sortino of 1.20 per trade**,** Sharpe of 0.19 per trade (~3.4 annualized), and max drawdown of 17.81R.

That backtest scored an Edge Score of 79, Quantprove's combined score for measuring if a trading strategy has a real statistical edge.

Then the live validation had 224 live trades with the EV holding from 0.31R to 0.28R, win rate still at 37% and a 92% distribution match: the live trades reproduced the same shape of results as the backtest.

That earned a Stability Score of 94.5, showing how closely live trading matched the backtest.

The live results also landed at the 57th percentile of the Monte Carlo projection, with all live trades staying within the P5–P95 band.

To rule out luck, I ran a permutation test with 10,000 reshuffled trade sequences. The real system beat all 10,000 randomized versions, with p < 0.0001.

Why do regimes and fees matter?

Regimes matter because a system will not and is not supposed to work in every market condition.

A long-only BTC system can look amazing in a 2020 bull regime and then get crushed when the bear market started in 2022. That does not mean the system is broken, it means the market has changed.

This is where you need to study performance by regime and use the data to decide when a system should be active, reduced, or turned off. This is where trader experience has its biggest measurable edge, as market cycles repeat over time.

Transaction costs matter as much, if not more.

Visible costs

  • Spread

  • Commission

  • Exchange + clearing fees

  • Regulatory fees

  • Swap

  • Funding rate

Hidden costs

  • Slippage

  • Partial fills

  • Gaps

I have backtested systems that looked very profitable until spread, commissions and slippage ate most of the expectancy. A simple rule helps:

Fee drag as % of EVRead
Under 10%Optimal
10-20%Warning zone
Over 20%Reconsider the system

The direct answer is this:

A strategy has an edge when fully systematic rules survive live validation and keep performing with positive expectancy across regime changes.

Disclosure: I am the founder of Quantprove, the tool that runs this validation and edge scoring. I built it because I was tired of doing it by hand.

What do you use to determine if your system has real edge?


r/algorithmictrading • • Apr 28 '26

Educational I mapped dominant cycle lengths across asset classes (data tables)

Thumbnail
gallery
13 Upvotes

Most cycle discussions stop at "the 4-year Bitcoin cycle" or "the 18-month equity cycle." I wanted to see what the spectrum actually shows once you run it across multiple asset classes with the same pipeline.

The hierarchy J.M. Hurst published in the 70s (10d, 20d, 40d, 80d, 20w, 40w, 84w, 54mo, 9.2y, 18y) holds up surprisingly well when you apply Goertzel DFT and Bartels significance testing to modern data. Same nominal periods recur across stocks, crypto, FX, and commodities. That is Hurst's Principle of Commonality, and it is empirically detectable.

Figure 1: full nominal hierarchy with tolerance bands. Cycles breathe. A "10-day" cycle measures 9 days in one instance, 11 in the next.

Figure 2: dominant detected periods across S&P 500, BTC, Gold, and EUR/USD on weekly bars. The 84-week (18-month) nominal shows up in every one.

Figure 3: representative power spectrum showing how peaks above the Bartels-significance threshold are read off.

Curious which cycles other people detect on instruments I did not look at. Bonds, single-stocks, ag commodities, anyone running this on minute-bar data?


r/algorithmictrading • • Nov 02 '25

Novice How did everyone get started?

13 Upvotes

I don’t come from a financial background but from a CS background.

I’m looking to educate myself in the field but i am completely overwhelmed with the amount of resources and don’t even know where to get started.

Any help is appreciated.


r/algorithmictrading • • Aug 11 '25

Backtest Update: Multi Model Meta Classifier EA 73% Accuracy (pconf>78%)

13 Upvotes

Hey r/algorithmictrading!

Since my last EA post, I’ve been grinding countless hours and folded in feedback from that thread and elsewhere on Reddit. I reworked the model gating, fixed time/session issues, cleaned up SL/partial logic, and tightened the hedge rules (detailed updates below).

For the first time, I’m confident the code and the metrics are accurate end-to-end, but I’m looking for genuine feedback before I flip the switch. I’ll be testing on a demo account this week and, if everything checks out, plan to go live next week. Happy to share more diagnostics if helpful (confusions, per-trade MAE/MFE, hour-of-day breakdowns).

Thank you in advance for any pointers (questions below) or “you’re doing it wrong” notes, super appreciated!

Model Strategy

  • Stacked learner: multi-horizon base models (1–10 horizons) → weighted ensemble → multi-model stacked LSTM meta classifier (logistic + tree models), with isotonic calibration.

    • Multiple short-horizon models from different families are combined via an ensemble, and those pooled signals feed a stacked meta classifier that makes the final long/short/skip decision; probabilities are calibrated so the confidence is meaningful.

  • Decision gates: meta confidence ≥ 0.78; probability gap gate (abs & relative); volatility-adjusted decision thresholds; optional sudden-move override.

  • Cadence & hours: Signals are computed on a 2-minute base timeframe and executed only during a curated UTC trading window to avoid dead zones (low volume+high volatility).

Model Performance OOS (screenshot below)

  • Confusion matrix {−1, +1}): [[3152, 755], [1000, 5847]] → TN=3152, FP=755, FN=1000, TP=5847 (N=11,680).

  • Per-class metrics

    • −1 (shorts): precision 0.759, recall 0.734, F1 0.746, support 4,293.

    • +1 (longs): precision 0.886, recall 0.792, F1 0.836, support 7,387.

  • Averages

    • Micro: precision 0.837, recall 0.771, F1 0.802.

    • Macro: precision 0.822, recall 0.763, F1 0.791.

    • Weighted: precision 0.839, recall 0.771, F1 0.803.

  • Decision cutoffs (post-calibration)

    • Class thresholds: predict +1 if p(+1) ≥ 0.632; predict −1 if p(−1) ≥ 0.632.

    • Tie-gates (must also pass):

      • Min Prob Spread (ABS) = 0.6 → require |p(+1) − p(−1)| ≥ 0.6 (i.e., at least a 60-pp separation).

      • Min Prob Spread (REL) = 0.77 → require |p(+1) − p(−1)| / max(p(+1), p(−1)) ≥ 0.770 (prevents taking trades when both sides are high but too close—e.g., 0.90 vs 0.82 fails REL even if ABS is decent).

    • Final pick rule: if both sides clear their class thresholds, choose the side with the larger normalized margin above its threshold; if either gate fails, skip the bar.

Execution

  • Pair / TF: AUDUSD, signals on 2-min, executed on ticks.

  • Period: 2025-07-01 → 2025-08-02. Start balance $3,200. Leverage 50:1.

  • Costs: 1.4 pips round-turn (commission+slippage).

  • Lot size: 0.38 (scaled based on 1000% average margin).

  • Order rules: TP 3.2 pips, partial at +1.6 pips (15% main / 50% hedge), SL 3.5 pips, downsize when loss ≥ 2.65 pips.

  • Hedging: open a mirror slice (multiplier 0.35) if adverse move from anchor ≥ 1.8 pips and opposite side prob ≥ 0.75; per-parent cap + cooldown.

  • Risk: margin check pre-entry; proportional margin release on partials; forced close at the end of the test window (I still close before weekends live).

Backtest Summary (screenshot below)

  • Equity: $3.2k → $6.2k (≈ +$3.0k), smooth stair-step curve with plateaus.

  • Win rate ≈ 73%, payoff 1.3–1.4, >1,100 net pips over the month; max DD stays low single-digits; daily Sharpe is high (short window caveat).

  • Signals fired: +1: 382, −1: 436; hedges opened: 39 (light use, mainly during adverse micro-trends).

What Changed Since Last Post

  • Added meta confidence floor and absolute/relative probability tie-gate to skip weak signals.

  • ATR-aware thresholds plus a sudden-move override to catch momentum without overfitting.

  • Fixed session filter (UTC hour now taken from bar timestamp) and aligned multi-TF features.

  • Rewrote partial-close / SL math to apply only to remaining size; proportional margin release.

  • Smarter hedging: parent-scoped cap, cooldown, anchor-based trigger, opposite-side confidence check.

  • Metrics & KPIs fixed + validated: rebuilt the summary pipeline and reconciled PnL, net/avg pips, win rate, payoff, Sharpe (daily/period), max DD, margin level. Cross-checked per-trade cash accounting vs. the equity curve and spot-audited random trades/rows. I’m confident the metrics and summary KPIs are now correct and accurate.

Questions for the Community

  1. Tail control: Would you cap per-trade loss via dynamic SL (ATR-based) or keep small fixed pips with downsizing? Any better way to knock the occasional tail to 2–3% without dulling the edge?

  2. Gating: My abs/rel probability gates + meta confidence floor improved precision but reduce activity. Any principled way you tune these (e.g., cost-sensitive grid on PR space)?

  3. Hedges: Is the anchor-based, cooldown-limited hedge sensible, or would you prefer volatility-scaled triggers or time-boxed hedges?

  4. Fills: Any best practices you use to sanity-check tick-fill logic for bias (e.g., bid/ask selection on direction, partial-fill price sampling)?

  5. Robustness: Besides WFO and nested CV already in the training stack, what’s your favorite leak test for multi-TF feature builders?


r/algorithmictrading • • Aug 10 '24

Is CQF a Scam?

13 Upvotes

I feel like CQF over promises and under delivers. Most of their materials are pretty basic things from academic finance. It's insane that the thing costs 10-20k. Thoughts?


r/algorithmictrading • • Mar 12 '20

ML in Portfolio Optimisation & Backtest Overfitting (Python)

13 Upvotes

ML in Portfolio Optimisation & Backtest Overfitting

We have just released MlFinLab version 0.7.0 which now includes the following:

Portfolio Optimisation:

We expand on the family of Hierarchical Risk Parity optimizers by including the HERC and HCAA algorithms by Thomas Raffinot.

  1. Raffinot, Thomas, The Hierarchical Equal Risk Contribution Portfolio (August 23, 2018)

  2. Raffinot, Thomas, Hierarchical Clustering Based Asset Allocation (May 2017)

  3. Python implementation

Backtest Statistics

In order to fight backtest overfitting we have implemented the following:

  • Probabilistic Sharpe Ratio

  • Deflated Sharpe Ratio

  • Minimum Track Record Length

The Sharpe Ratio Efficient Frontier by David H. Bailey and Marcos Lopez de Prado available here. It provides a deeper understanding of Sharpe ratios implemented and minimum track record length.

A big thank you to Aditya Vyas and Illya Barziy, respectively.


r/algorithmictrading • • Oct 02 '26

Backtest FIb Retracement based multi-asset portfolio strategy. Roast my method.

Thumbnail
gallery
12 Upvotes

I have put together a strategy trading US30.cash, US100.cash, GER40.cash and AUS200.cash over 8 years (in-sample). Strategy relies on Fib retracements. The average yearly ROI is around 23%.

The strategy is built to strictly obey FTMO 2-step drawdown rules, so that I can safely run it on a funded account.

Initial equity: $20k

Roast my method.


r/algorithmictrading • • Jun 29 '26

Question my best algo bot has a 1.52 Sharpe Ratio

12 Upvotes

my best algorithm has a 1.52 sharpe ratio and it's a daytrader.

daily-rebalanced FAST residual momentum. Beta-residualize each S&P-100 mega-cap vs SPY over 40d.

I tested several hundred different algorithms, 99% barely beat the SPY. I have an LLM researching more that get sent to a quant engine that are backtested to see if they pass the SPY gate. They are all duds.

What's your best performance?

you can now bring your API key and test our stock database for free and make any models that you want. You can also test your own models.


r/algorithmictrading • • Apr 14 '26

Backtest Is this a good (or normal) back test? Shall I start running it live?

Post image
12 Upvotes

I'm new to automated trading. I have been trading manually for years and thought it was time automate my strategy.

My questions are:

-Is this much difference between friction - no friction normal for a swing trrading strategy?

-Do you guys think the strategy looks good enough for me to start running it?

Non-penalized pf is 1.624 vs 1.134 penalized.

EDIT: I have a follow-up post where I used your suggestions to improve on this strategy. Here's the link.


r/algorithmictrading • • Nov 29 '25

Question My 3/8 MA crossover strategy works, but I keep failing at taking profit and cutting losses — advice?

Post image
12 Upvotes

I’ve been running my own algo system for a year (Python + IBKR).
The core strategy is a 3/8 moving-average crossover, which is naturally volatile.
Because of this, it produces both very strong runs and very sharp reversals.

The problem is not the strategy — the problem is my execution.

Here is my performance chart (attached).
If I removed three trades where I refused to cut losses, the yearly return would be around +45%.
Instead, what happened was:

  • early in the year I held a trade and let it fall to −20%

  • later I repeated the same mistake twice, creating another −25% drawdown

  • the rest of the trades were positive and well-timed

  • emotionally I find it difficult to take profit early or accept small losses

So now I'm looking for guidance who trade volatile MA-crossover systems.

How do you handle exits with strategies like 3/8 crossovers?


r/algorithmictrading • • Sep 08 '25

Novice Starting my algo trading journey – how are you all approaching it?

12 Upvotes

Hey everyone, I’m a student who’s been trading ICT manually for ~2 years, and recently I’ve started my algo trading journey. So far I’ve covered Python basics + NumPy + Pandas, and I’d say I’m about 30% into learning.

I sometimes feel solo-learning gets tough, so I wanted to ask:

For those who are just starting, how are you practicing?

For those who are experienced, what was the biggest difference you noticed between backtesting and live trading?

Would love to hear how others are approaching their learning. Always curious to exchange ideas and understand different perspectives 🚀


r/algorithmictrading • • Aug 28 '25

Backtest Walk-Forward Tested Strategy on Gold Futures utilising econometrics with ML and HMM. Looking for Feedback

Post image
12 Upvotes

Hey folks,

I’ve been working on a systematic strategy for Gold Futures by utilising HMM, and I recently posted my results and got excellent feedback. I have significantly changed the strategy since then and would love some feedback. I have also incorporated Econometrics with ML, along with HMM for regime detection.

Process & Tools Used

  • Features normalized and volatility-adjusted. Where possible, I used ARCH to compute GARCH volatility estimates.

  • Parameters selected using walk-forward optimization and not just in-sample fitting. Each period was trained and then tested out-of-scope on unseen data.

  • Additional safeguards:

    • Transaction costs + slippage modeled in.

    • Bootstrapped confidence intervals on Sharpe.

  • Evaluation metrics included Sharpe, Sortino, Max Drawdown, Win Rate, and Trade Stats.

Results (2006–2025):

  • Total Return: +1221% vs. +672% for Buy & Hold.

  • Sharpe Ratio: 2.05 vs. 0.65 (Buy & Hold).

  • Sortino Ratio: 5.04.

  • Max Drawdown: –14.3% vs. –44.4%.

  • Trades: 841 over the test horizon.

  • Win Rate: 34% (normal for trend/momentum systems).

  • Average trade return: +0.20%.

  • Best/Worst Trade: +6.1% / –0.55%.

  • Sharpe 95% CI (bootstrap): [1.60, 2.45].

I’ve tried to stay disciplined about avoiding overfitting by:

  • Walk-forward testing rather than one big backtest.

  • Using only out-of-scope data to evaluate each test window.

  • Applying robust statistical checks instead of cherry-picking parameters.

That said, I know backtests are never the full picture. Live trading can behave differently.

Looking for Feedback:

  • Do you think the evaluation setup is robust enough?

  • Any blind spots I might be missing?

  • Other stress tests you’d recommend before moving toward a paper/live implementation?

  • I am now planning to implement this strategy in Ninja for paper trading. One challenge that I face is that Ninja uses a different language, and my strategy uses libraries that are not available on Ninja. How should I proceed with implementing my strategy?

Appreciate any constructive feedback!


r/algorithmictrading • • Jul 26 '25

Question from an AI Engineer: How can I get back into algo trading in 2025?

12 Upvotes

How can I get back into day trading after a long break using today’s tools, with the goal of fully automated day trading?

I’m an AI engineer (specialized in Generative AI) and I’m exploring how to combine my technical skills with my long-standing interest in trading. After years away from the markets, I’m looking to re-enter the world of algo trading in 2025—and I’d love to hear your thoughts, experiences, and tool recommendations.

A bit about me:

In my main profession, I’m an AI developer focused on Generative AI. I live in Germany, and Python, n8n, and training AI models with data are part of my daily toolkit. Professionally, however, I don’t work in finance or the stock market.

My previous toolset consisted mainly of MetaTrader 5, Interactive Brokers API, Multicharts and Python for backtesting.

That said, because my work as an AI developer can sometimes feel quite abstract, I’ve found myself looking for a more practical field of application—and I’d love to return to short-term trading and combine it with my AI skills. I already have plenty of ideas on how to apply AI in trading.

A long time ago (well before the AI era), I used to trade classical and well-known systems quite successfully—such as Friday Gold Rush, Turnaround Tuesday, range breakouts, etc. I had implemented these in MetaTrader 5 with optimized parameters, usually on M15 or H1 charts, using open/close logic. I generally avoided backtesting with tick data, since I never fully trusted it (especially in MetaTrader), and instead designed my logic around open/close data.

I also had a trading strategy built from a rather wild combination of different indicators—which, surprisingly, performed very well and consistently.

Due to professional and personal reasons, I had to stop day trading. While one might assume that automated trading doesn’t take up much time, I stopped entirely to clear my head and focus on other things. Since then, I’ve been investing in a more traditional long-term way—ETFs and individual stocks. Of course, I’ve made the usual mistakes in both trading and investing—but I’ve also learned a lot from them.

Now I have a few questions for the community:

  • Do you have any sources or strategy ideas worth looking into or building upon? I’d also be interested in news-based strategies that involve automated news analysis and AI-based news evaluation, or in AI-based pattern recognition of candlesticks or other structures—or even combinations of such methods. I know this question has probably been asked a thousand times, but I’d still appreciate any tips.

  • I know MetaTrader 5 quite well, but I’ve heard a lot about TradingView lately. I also found NinjaTrader interesting in the past. What platforms do you currently use for automated trading, and what would you recommend? Can you backtest programmatically in TradingView in a meaningful way? I’m looking for a data feed that lets me query at least 10 years of historical M5 data for Nasdaq—ideally via API. Do you have any tips?

I’ve already read a lot in the forums and bookmarked many useful links. But maybe someone here has a similar background or tech stack—and has already answered the same questions for themselves.

I'm especially interested in advice, experiences, and exchange with other algo traders. Whether you're using AI, building systems, or refining strategies—I’m eager to learn what’s working for you in today’s trading landscape.


r/algorithmictrading • • Sep 22 '24

As a person from non math background what important maths topic I need to learn to start algorithmic trading

12 Upvotes

I know a good amount of coding I am fine in basic maths I left maths in High school hence I am not aware of Advance maths Like calcus and linear algebra Hence tell me what more topic I need to learn in maths so that I can get a understanding of algorithm trading. Regards


r/algorithmictrading • • Aug 04 '24

Where did you guys learn algorithmic trading from? How did you develop your own system from scratch.

12 Upvotes

I have been trying to find resources to help me with setting up my own algotrader, But they arent exactly useful and there is a bunch of clutter. So I am curious how did you guys manage to do it.


r/algorithmictrading • • Jun 17 '24

Open-Sourcing High-Frequency Trading and Market-Making Backtesting Tool with Examples

12 Upvotes

https://www.github.com/nkaz001/hftbacktest

Hello,

It's been some time since I last introduced HftBacktest here. In the meantime, I've been hard at work fixing numerous bugs, improving existing features, and adding more detailed examples. Therefore, I'd like to take this opportunity to reintroduce the project.

HftBacktest is focused on comprehensive tick-by-tick backtesting, incorporating considerations such as latencies, order queue positions, and complete order book reconstruction.

While still in the early stages of development, it now also supports multi-asset backtesting in Rust and features a live bot utilizing the same algo code.

The experimental Rust implementation is here or https://crates.io/crates/hftbacktest/0.1.5

With the gridtrading example: The complete process of backtesting Binance Futures using a high-frequency grid trading strategy implemented in Rust.

Currently, the L3 Market-By-Order backtesting is a work in progress.

The Python version is delivered with:

Key features:

  • Working in Numba JIT function.

  • Complete tick-by-tick simulation with a variable time interval.

  • Full order book reconstruction based on L2 feeds(Market-By-Price).

  • Backtest accounting for both feed and order latency, using provided models or your own custom model.

  • Order fill simulation that takes into account the order queue position, using provided models or your own custom model.

Tutorials:

Full documentation is here.

I'm actively seeking feedback and contributors, so if you're interested, please feel free to get in touch via the Discussion or Issues sections on GitHub, or through Discord u/nkaz001.


r/algorithmictrading • • Sep 18 '23

Opensource algo-trading platform

12 Upvotes

Just released version 2.0 of my open source algo-trading platform called roboquant.

It is very fast and flexible. So if you have much historic data or complex strategies, this might suit you. The engine itself can handle over 1.2 billion candle-sticks per second on a modern server.
Please note, it is written in Kotlin and not Python. Unfortunately I couldn't get the performance from Python that I needed for my use-cases.

Feedback is very welcome.

The GitHub repo is: https://github.com/neurallayer/roboquant


r/algorithmictrading • • Aug 11 '21

Check out, use, and contribute to my cryptocurrency trading bot!

12 Upvotes

Link to the project: https://github.com/ryanr08/DeepThought

So I decided to make an open source Python crypto trading bot. The bot interfaces with the coinbase pro API and can place limit buy/sell order with coinbase pro as well as trade with paper money.

The bot doesn't have any serious algorithm implemented (only a couple of sample ones), rather, it has the framework for constructing, backtesting, and actively using your algorithm to trade. The idea is that you can simply write your own algorithm in the algorithms.py file and then immediately run it in backtest.py to see how well it would do on any given cryptocurrency, or run it in cryptobot.py to actually use it on real time data.

I would love contributions to the project (check out the issues tab) or for you to just use it to write your own trading algorithm without the hassle of setting up the entire framework to obtain real time data, trade, and backtest your strategy. Please check it out and let me know your thoughts!


r/algorithmictrading • • Jul 26 '21

Newbie question

12 Upvotes

I'm new to algorithm trading and would like to get into it, but im not entirely sure where to start. I'm sorry if this question has been asked before😅, but where should I start? Is it better to use an algorithm and trade manually or an automated one? Any advise would be appreciated


r/algorithmictrading • • Dec 14 '20

Open source trading bot running on Binance USDT Futures

Thumbnail
github.com
12 Upvotes

r/algorithmictrading • • Apr 19 '20

Created a list of under valued stocks for you guys

12 Upvotes

Each company is rated based on three different metrics: price to book value, quarterly earnings, forwardEps minus trailingEps

The lower rating the better. Each rating is summed to give the total rating.

For example all s&p500 companies are sorted by priceToBookValue ratio. The number 1 company receives 1 point the number 2 company receives 2 points and so forth.

This is repeated for the other two metrics.

It would be nice if a company excelled at all three metrics and only received 3 points total but that's not realistic. A low profit to book value means the company stock price is under valued. If such a company also has good quarterly earnings growth and a good forward outlook then it is super under valued. And that is the point of this exercise.

Source code: https://github.com/recola-wand/undervalued-stocks

doc (removed)

Edit: this one divides eps by stock share price so we can get a more accurate picture of earnings per dollar. By doing this I noticed DAL was kind of high on the list so i'm going to add another metric of profit margin to try and weed out companies that have less cash to work with and may be at risk for bankruptcy.

doc (removed)

Edit 2:

Ok I think this one is the most accurate. Instead of using trailing and forward eps and dividing by stock price I'm just using forwardPE. I also take into account pegRatio and if either PE or pegRatio are negative the company gets dinged hard (like with dal or luv).

So this gives us a list of companies that will survive the pandemic and are under priced.

Enjoy!

doc (removed)

Edit 3:

Added more details here including market price, earnings date, industry, and analyst recommendations. Even if the stock appears undervalued these analysts may know more than i do. You can go down the list and pick all the strong buys. Should be a good deal!

I added the industry because I plan on making a "diversified" portfolio out of this

https://docs.google.com/spreadsheets/d/1Y03Nkgh1g-lixkOjxL65hCkz1NQg3JKx_dY2x6Nn8sM/edit?usp=sharing

Edit 4:

With this list I severely penalized any company that had negative earnings or growth. The top 318 companies are clearly set apart from the bottom companies.

https://docs.google.com/spreadsheets/d/1bRtgLmolBpre5nDeO7UlvCyuRcmgE-QMFGj7QwHs1lw/edit#gid=328425522

Edit 5:

Same as above with severe penalty but in addition to having a column for priceToBook I also included one for 52WeekAverage which will give more weight to those stocks that were hardest hit. So this is is the real gem here. It should have companies with a positive future earning outlook with the lowest price.

https://docs.google.com/spreadsheets/d/1dKo6WyTWvEAqqSv2Vn_eVNUGaEP-vGt151TBmOo_C5g

Edit 6:

Same as above but sorted by industry so you can make your own portfolio. Pick the first one or two stocks from each industry. I also put analyst ratings next to my rating. Higher is better. Note this spreadsheet contains ALL companies in the s&p 500. I'm not saying they're all buys.

Make a copy of this spreadsheet and delete the bottom half from each industry and you'd have a solid portfolio of stocks that are on the cheap

https://docs.google.com/spreadsheets/d/1lH1PTOElTNEgzL_bR090Q8_jDfNq_9PeyxlhfPB8hSk/edit?usp=sharing

Edit 7:

And finally, my portfolio based off of this. I'll give each industry equal weight even though different industries may have more stocks than others

https://docs.google.com/spreadsheets/d/14BBMPQFhg1YoCn1wwKu5aemeifaT5J553LXhTmlMMoQ/edit#gid=348200405

Edit 8:

I glanced at the balance sheet of every company in that portfolio since I'm putting money in this. I ended up removing the following companies due to decreasing assets and decreasing shareholder equity: xray, nwl, kim, hpe, glw, arnc


r/algorithmictrading • • Sep 16 '18

I wrote a program to find undervalued dividend stocks. What next?

12 Upvotes

I am a beginner in the finance world, and after learning some basics about value investing, I wrote a program to filter for stocks that meet Benjamin Graham's seven criteria to identify strong value stocks. These are:

  • Look for a quality rating that is average or better

  • Total Debt to Current Asset ratios of less than 1.10

  • Current Ratio over 1.50

  • Positive earnings per share growth during the past five years with no earnings deficits

  • Price to earnings per share (P/E) ratios of 9.0 or less

  • Price to book value (P/BV) ratios less than 1.20

  • Must currently be paying dividends

This leaves me with only with a handful of stocks. For example, on NASDAQ the following symbols currently meet the criteria:

ANAT BDJ DX KHC MITT NRZ PRU RGA RLGY SALM SBS SKM TM TWO ZNH

My data sources are the NASDAQ Symboldirectory and Yahoo Finance for now, because I didn't find any free APIs that had all the data I needed.

Any suggestions on how to improve and what to look at next?


r/algorithmictrading • • Mar 01 '18

Why is machine learning in finance so hard?

Thumbnail
hardikp.com
12 Upvotes

r/algorithmictrading • • Jul 19 '26

Question Is a profitable algo possible purely based off price action?

11 Upvotes

I’ve been trading for 3 years, only ICT concepts. Have been trying to find a strategy to automate but don’t think it’s possible with ICT concepts. I’ve tried some ORB strats, opening range retests, projections, some indicators, but am really just out of ideas. Does anyone have any recommendations on where to gain knowledge or come up with new ideas? Any experience or advice is greatly appreciated and welcome. Thank you in advance