r/algorithmictrading • u/Goziri • Feb 04 '26
Backtest Getting into AlgoTrading
Hello everyone, I'm excited to start my algotrading journey. I've been coding up my own person algotrading framework that lets me write strategies once and then easily backtest, optimise and deploy them live.
I have coded up a simple strategy that uses a fast and a slow sma indicators to test the framework. The strategy closes any sell position and buys the market when there is a crossover, vice versa for a crossunder.
I initially bactested it using fast_sma(10) and fast_sma(20), but after optimisation it showed that fast_sma(10) and slow_ma(40) yielded more returns.
From the backtest result (yes, commission is included as spread), this strategy will be a painful one to run live, as it has many losing days and few to little winning days, but a win could easily take care of previous losses.
I'm open to any criticism or advice you have to give me about the framework and algotrading in general.










8
u/Exarctus Feb 04 '26
Winrate of 12% with a profit factor of 1.6 and 1.8 sharpe doesn’t make any sense.
You’ve (or rather Claude) made a buggy mess brother.
6
u/FortuneXan6 Feb 04 '26
lol that drawdown, not a chance anyone would hit a -67% drawdown and not cut losses with an algo.
algo trading doesn’t remove emotion the way that people think it does.
5
u/CKtalon Feb 04 '26
You are just trying to overfit your test/out-of-sample data by finding the best parameters through “optimisation”.
3
u/literally_joe_bauers Feb 04 '26
This does not look legit.. even /w highest end bots (e.g deep lob etc.) you will not even get close to such results
2
u/Backtester4Ever Feb 04 '26
Sounds like you're on the right track with your framework. One thing to consider is the psychological aspect of trading. Even with a solid backtest, it can be tough to stick to a strategy that has many losing days. It's easy to start second-guessing the system or making impulsive trades. I've found that using a tool like WealthLab can help with this. It allows you to backtest and forward test your strategies, giving you more confidence in them. Plus, it has a community where you can share ideas and get feedback. Just remember, the key is consistency and discipline. Stick to your strategy, even when it's tough.
2
u/m3m0m2 Feb 04 '26
Good exercise for coding experience, but your test clearly has negative sharpe ratio for 2025.
1
u/Manbearjosh Feb 04 '26
Where did you get your data for the backtest engine?
1
u/Crazy-Arm9451 Feb 05 '26 edited Feb 05 '26
Hello mate, before going live please make sure to not use a brutally grid optimised parameter combination for your indicators. Just because It Is the combination that had higher returns in the past It doesent mean It Will keep up in the future, actually It Is more likely to not do so. I would encourage you to not optimise in-sample, which Is overfitting at its purest form, but to develop some model that has good out of sample performance. I burnt many and many accounts doing this exact thing
1
u/SupaNJTom8 Feb 06 '26
Anyway, you can share the gate hub repository on how you built that are using python with reactJS?
1
u/Sketch_x Feb 07 '26
Will keep my opinions to myself on the stats and optimisation - i would just recommend you don’t take this live. Roll it forward on demo for a quarter at least.
UX is nice, my UX is literally a terminal and CSV outputs, does want it needs to do but would be nice to wrap it in a UX like this - thanks for the inspiration and addition on my todo list!
2
u/Leo6-2 Feb 04 '26
wow that is so cool ! ill dm you for some question i have been "trying" to go this path but im like all over the show with the tech stack and what the f im doing lol
2
u/JustinPooDough Feb 05 '26
I would spend less time coding a web ui and more time learning how to leverage pandas, historical data providers and possibly cloud compute to do deep research and feature identification. 99.9% of the work is identifying features and patterns that net returns consistently. It's almost impossible for a retail trader, but still plausible.
1
u/Impossible_prophet Feb 08 '26
And then you find there is a slippage, commissions, flash crashes, overfitting, market sentiment changes etc. good luck on this path though, I spend 1000+ iterations before my experience was good enough to understand all aspects of