Hello, I am working on my own trading system and I came across this architecture in a book. I made few changes based on what I already know.
The Celery workers fetch data from sources like Yahoo Finance,AlphaVantage and others, process it, and publish it via Redis. Bots subscribe to this data, make trading decisions, and execute orders through brokers like XTB and Bitso. I thinks it is scalable, and I am also planning to use Rapsberry Pis to support the architecture. I still need to design the bots and think about how to improve my backtesting, model training and monitoring workflows. what do you think? any suggestions?
This strategy is mainly built on a single indicator that I found, the RSI Divergence from ProRealCode. This indicator detects bullish and bearish divergences between price and the RSI. A bullish divergence occurs when the stock price makes new lows while the indicator starts to climb upward. A bearish divergence occurs when the stock price makes new highs while the indicator starts to go lower. We also implement a moving average crossover as a filter. So with something as simple as one indicator and one filter we can get something quite interesting. Out-of-sample for this strategy is since 2021-01-01.
Setup for Backtest
Market: US Crude Oil (WTI)
Contract: 1 € per point
Broker: IG
Testing environment: ProRealtime 12
Timeframe: Daily
Time zone: CET
No fees and commissions are included.
Result
Total gain: 28 699.3 €
Average gain: 123.17 €
Total trades: 233
Winners: 172
Losers: 61
Breakeven: 0
Max drawdown: –2 887.7 €
Risk/reward ratio: 1.15
Total time in the market: 35.52 %
Average time in the market: 11 days, 15 hours
CAGR (10 000 € in starting capital): 4.61 %
Entry Conditions
~Long Entry~
MA[20] is higher today than yesterday.
A bullish signal from the RSI Divergence Indicator [3,40,70,20].
~Short Entry~
MA[20] is lower than yesterday.
MA[10] is also lower than yesterday.
A bearish signal from the RSI Divergence Indicator [3,20,70,20].
Exit Conditions
~Long Exit~
A bearish signal from the RSI Divergence Indicator [3,40,70,20]
Or if the number of bars since entry exceeds 40.
~Short Exit~
A bullish signal from the RSI Divergence Indicator [3,20,70,20]
Or if the number of bars since entry exceeds 40.
If you have any improvements to this strategy let me know.
Hey guys i am a software engineer with almost 4 years of industry experience. I also have extensive experience in startups. I just say this to say I'm not a newbie to software engineering, and I think I'm somewhere better than the average. I really want to challenge myself and become a quant dev or a maestro at algorithmic trading. I would love any ideas on extensive resources on where to start this new challenging journey so that I may land a job at top trading firm
I know that numerous backtesting tools exist. But most of them do not offer comprehensive tick-by-tick backtesting, taking latencies and order queue positions into account.
Consequently, I developed a new backtesting tool that concentrates on thorough tick-by-tick backtesting while incorporating latencies, order queue positions, and complete order book reconstruction.
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.
Example:
Here's an example of how to code your algorithm using HftBacktest. For more examples including market-making and comprehensive tutorials, please visit the documentation page here.
@njit
def simple_two_sided_quote(hbt, stat):
max_position = 5
half_spread = hbt.tick_size * 20
skew = 1
order_qty = 0.1
last_order_id = -1
order_id = 0
# Checks every 0.1s
while hbt.elapse(100_000):
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
# Obtains the current mid-price and computes the reservation price.
mid_price = (hbt.best_bid + hbt.best_ask) / 2.0
reservation_price = mid_price - skew * hbt.position * hbt.tick_size
buy_order_price = reservation_price - half_spread
sell_order_price = reservation_price + half_spread
last_order_id = -1
# Cancel all outstanding orders
for order in hbt.orders.values():
if order.cancellable:
hbt.cancel(order.order_id)
last_order_id = order.order_id
# All order requests are considered to be requested at the same time.
# Waits until one of the order cancellation responses is received.
if last_order_id >= 0:
hbt.wait_order_response(last_order_id)
# Clears cancelled, filled or expired orders.
hbt.clear_inactive_orders()
last_order_id = -1
if hbt.position < max_position:
# Submits a new post-only limit bid order.
order_id += 1
hbt.submit_buy_order(
order_id,
buy_order_price,
order_qty,
GTX
)
last_order_id = order_id
if hbt.position > -max_position:
# Submits a new post-only limit ask order.
order_id += 1
hbt.submit_sell_order(
order_id,
sell_order_price,
order_qty,
GTX
)
last_order_id = order_id
# All order requests are considered to be requested at the same time.
# Waits until one of the order responses is received.
if last_order_id >= 0:
hbt.wait_order_response(last_order_id)
# Records the current state for stat calculation.
stat.record(hbt)
Additional features are planned for implementation, including multi-asset backtesting and Level 3 order book functionality.
I've just started learning how to code for a trading algorithm in Python. I use sterling trader pro and thinkorswim, which if either is better for python? Also what kind of software should I look for to interface my algorithm and trading platform? Any insight would be appreciated.
TL;DR - What kind of trading data are you storing and how/where are you storing it? Also how much does it cost for you per month?
I'm new to algorithmic trading, and I'm prototyping a platform with a friend (I'm working on the data engineering part, they are working on the data science part). We're looking at crypto opportunities, and specifically starting with 1m OHLCV data across a few different exchanges (considering all pairs per exchange).
I'm not sure what tools & infrastructure we'll use yet (likely use AWS for everything), but goes without saying: amount of data adds up fast! How do you all handle this? Specifically:
What kind of data are you storing?
What is your data engineering infrastructure? And where is it / where are you hosting?
Just wondering if anyone's used python reinforcement learning applied to speculative markets like crypto. I've started pursuing this but was wondering if anyone's had success.
The "environment" would be OCLHV data and other key features over time. Rewards are successful trades.
It would be good if it was a book that explained things from a beginners prespective amd then go into more details since Im not very experiences in the algorithms
This is walk-forward of ensemble model for selling put spreads on "good days". The model was trained to find those good days - ca 60 trades per year (retrained each year with another year of training data added). The outcome looks quite good, yes, the risk is pretty high but due to high hit rate losses are rare. Would you normally consider such amount of walk-forward back testing enough to start?
Every night I log ~6,000 US stocks, including ones that later got delisted (no survivorship bias). I used ~1 year of these logs to test 24 popular one-line trading "rules."
Method - For each rule (e.g. "RSI below 30 means a bounce is coming"), find every time it fired and check whether the stock was up 20 trading days later. - Baseline: stocks with similar volatility on the same day, not the whole market. Otherwise volatile stocks look like winners just because they move more. - Rules and pass criteria were fixed before looking at results. Benjamini-Hochberg correction across all 24.
Results (as of late Oct 2026) - Real edge: 0 / 24 - No measurable difference: 13 - Volatility illusion (looked good only because the stocks were more volatile): 7 - Worse than baseline: 4
Examples - RSI < 30 = bounce: 50.1% up vs 49.7% expected (9,871 cases) - 52-week-high breakout: 52.3% vs 51.2%, volatility illusion (12,649 cases) - Penny stocks under $5 run harder: 38.6% vs 42.8%, worse (15,857 cases) - Buy after a 20%+ drop in 5 days: 38.6% vs 41.8%, worse (6,182 cases) - CEO/CFO insider buys: 57.1% vs 53.0%, but only 837 cases, not significant after correction
Limitations - ~1 year of data, mostly one market regime. - "Up after 20 days" is one lens, not a full backtest with stops and position sizing. - This doesn't show technical analysis is useless. Only that these one-line rules, alone, didn't beat a volatility-matched baseline in this sample.
Hey i am a complete beginner who wants to learn Algorading. Can anybody suggest some good free resources where I can learn Algo trading from basics to advance.
I combined eight independent XAUUSD modules into a single portfolio and tested the final structure across development, frozen-parameter OOS and older stress periods.
The purpose of the split was to separate the years that influenced module selection and parameter choices from the years used to evaluate the finished portfolio.
FULL REAL-TICK PORTFOLIO RUN
Period: January 2021 to September 2026
Initial balance: USD 1,000
Ending balance: USD 3,903.12
Closed trades: 1,511
Profit factor: 2.93
Maximum relative equity drawdown: 12.82%
The modules were evaluated together because nominal strategy count can hide concentrated XAUUSD exposure. Portfolio-level floating equity was therefore treated as the main risk measure.
YEAR-BY-YEAR RESULTS
2021: +45.03%, PF 3.03
2022: +32.36%, PF 2.71
2023: +16.22%, PF 2.82
2024: +13.62%, PF 1.94
2025 OOS: +16.84%, PF 3.01
2026 OOS through September: +31.79%, PF 7.18
Returns varied materially by year, but the edge did not disappear after the parameter freeze. Both OOS years remained profitable. The 2026 PF is a partial-year observation and should not be treated as a stable expectation.
BLOCK-BOOTSTRAP CHECK
I ran 10,000 paths using the complete 2021–2026 deal sequence and resampled 50-deal blocks to preserve short clusters of wins and losses.
Median ending balance: USD 3,896
5th–95th percentile ending balance: approximately USD 3,504–4,318
Median maximum realised-balance drawdown: 4.1%
95th-percentile maximum realised-balance drawdown: 8.0%
LIMITATIONS
The bootstrap rearranges realised deal results. It does not reconstruct every floating basket, reproduce broker-specific execution or invent unseen future regimes. Because of that, the observed MT5 relative equity drawdown of 12.82% remains the more relevant risk figure.
The next step is live observation of spreads, slippage, swap, execution and floating-basket behaviour. The backtest is evidence of historical robustness, not proof of future performance.
I am new to the world of Quant Finance , found many sources but I feel Distracted don't know how to start . I already have a Background in Finance and Programming (C++ and Python ) I just Need Sources to learn Quant Finance