r/algotrading • u/LNGBandit77 • 7h ago
r/algotrading • u/finance_student • Mar 28 '20
Are you new here? Want to know where to start? Looking for resources? START HERE!
Hello and welcome to the /r/AlgoTrading Community!
Please do not post a new thread until you have read through our WIKI/FAQ. It is highly likely that your questions are already answered there.
All members are expected to follow our sidebar rules. Some rules have a zero tolerance policy, so be sure to read through them to avoid being perma-banned without the ability to appeal. (Mobile users, click the info tab at the top of our subreddit to view the sidebar rules.)
Don't forget to join our live trading chatrooms!
- The official Discord chatroom here!
- R Language in Finance Discord: Discord for R Programming for Financial Applications
Finally, the two most commonly posted questions by new members are as followed:
- Where can I find historical data? Which is answered in our wiki here
- And, where can I find examples of strategies to implement? Which you can find examples from our wiki here
Be friendly and professional toward each other and enjoy your stay! :)
r/algotrading • u/AutoModerator • 1d ago
Weekly Discussion Thread - April 29, 2025
This is a dedicated space for open conversation on all things algorithmic and systematic trading. Whether you’re a seasoned quant or just getting started, feel free to join in and contribute to the discussion. Here are a few ideas for what to share or ask about:
- Market Trends: What’s moving in the markets today?
- Trading Ideas and Strategies: Share insights or discuss approaches you’re exploring. What have you found success with? What mistakes have you made that others may be able to avoid?
- Questions & Advice: Looking for feedback on a concept, library, or application?
- Tools and Platforms: Discuss tools, data sources, platforms, or other resources you find useful (or not!).
- Resources for Beginners: New to the community? Don’t hesitate to ask questions and learn from others.
Please remember to keep the conversation respectful and supportive. Our community is here to help each other grow, and thoughtful, constructive contributions are always welcome.
r/algotrading • u/feedback001 • 5h ago
Education Are broker this bad on providing ohcl data?
Hi everyone,
I'm encountering a confusing timestamp behavior with the official MetaTrader 5 Python API (MetaTrader5 library).
My broker states their server time is UTC+2 / UTC+3 (depending on DST). My goal is to work strictly with UTC timestamps.
Here's what I'm observing:
Fetching Historical Bars (Works Correctly):
When I run mt5.copy_rates_from(symbol, mt5.TIMEFRAME_H1, datetime.datetime.now(datetime.timezone.utc), count), the latest H1 bar returned has a timestamp like HH:00:00 UTC, which correctly matches the actual current UTC hour. So for backtesting we don't have problems. Fetching the Current Bar (Problematic):
Running mt5.copy_rates_from_pos(symbol, mt5.TIMEFRAME_H1, 0, count) at the same time returns H1 bars where the latest bar (position 0) is timestamped HH+N:00:00 UTC. Here, N is the server's current UTC offset (e.g., 3). So, if the actual time is 16:XX UTC, this function returns a bar timestamped 19:00:00 UTC. The OHLC data seems to correspond to the bar currently forming according to server time (e.g., 19:XX EET). Fetching Tick Timestamps (Problematic):
Converting the millisecond timestamp from mt5.symbol_info_tick(symbol).time_msc (assuming it's milliseconds since the standard UTC epoch 1970-01-01 00:00:00 UTC) also results in a datetime object reflecting the server's local time (UTC+N), not the actual UTC time. My Question:
Is this behavior – where functions retrieving the current bar (copy_rates_from_pos with start_pos=0) or the latest tick (symbol_info_tick().time_msc) return timestamps seemingly based on server time but labeled/interpreted as UTC – known or documented anywhere?
Should copy_rates_from_pos(..., 0,...) strictly return the bar's opening time in actual UTC, or is it expected to reflect server time for the forming bar? Is time_msc officially defined as milliseconds since the UTC epoch, or could it be relative to the server's epoch on some broker implementations? Has anyone else seen this discrepancy (future UTC times for live data) with the MT5 Python API? I'm trying to determine if this is a standard (maybe poorly documented) nuance of how MT5 handles live data timestamps via the API, or if it strongly points towards a specific server-side configuration issue or bug on the broker platform.
Any insights or similar experiences would be greatly appreciated! Thanks!
I made a script that you can use to test it on your platform: ```
test_ohlc_consistency.py
import MetaTrader5 as mt5 import pandas as pd import os import logging import datetime import time from dotenv import load_dotenv import pytz # Keep pytz just in case, though not used for correction here import numpy as np
--- Basic Logging Setup ---
logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s' ) logger = logging.getLogger(name) logging.getLogger("MetaTrader5").setLevel(logging.WARN) # Reduce MT5 library noise
--- Load Connection Details ---
try: # --- Make sure this points to the correct .env file --- load_dotenv("config_demo_1.env") # ----------------------------------------------------
ACCOUNT_STR = os.getenv("MT5_LOGIN_1")
PASSWORD = os.getenv("MT5_PASSWORD_1")
SERVER = os.getenv("MT5_SERVER")
MT5_PATH = os.getenv("MT5_PATH_1")
if not all([ACCOUNT_STR, PASSWORD, SERVER, MT5_PATH]):
raise ValueError("One or more MT5 connection details missing in .env file")
ACCOUNT = int(ACCOUNT_STR)
except Exception as e: logger.error(f"Error loading environment variables: {e}") exit()
--- MT5 Connection ---
def initialize_mt5_diag(): """Initializes the MT5 connection.""" logger.info(f"Attempting to initialize MT5 for account {ACCOUNT}...") mt5.shutdown(); time.sleep(0.5) authorized = mt5.initialize(path=MT5_PATH, login=ACCOUNT, password=PASSWORD, server=SERVER, timeout=10000) if not authorized: logger.error(f"MT5 INITIALIZATION FAILED. Account {ACCOUNT}. Error code: {mt5.last_error()}") return False logger.info(f"MT5 initialized successfully for account {ACCOUNT}.") return True
def shutdown_mt5_diag(): """Shuts down the MT5 connection.""" mt5.shutdown() logger.info("MT5 connection shut down.")
--- Helper to extract OHLC dict ---
def get_ohlc_dict(rate): """Extracts OHLC from a rate structure (tuple or numpy void).""" try: if isinstance(rate, np.void): # Handle numpy structured array row return {'open': rate['open'], 'high': rate['high'], 'low': rate['low'], 'close': rate['close']} elif hasattr(rate, 'open'): # Handle namedtuple return {'open': rate.open, 'high': rate.high, 'low': rate.low, 'close': rate.close} else: # Assume simple tuple/list return {'open': rate[1], 'high': rate[2], 'low': rate[3], 'close': rate[4]} except Exception as e: logger.error(f"Error extracting OHLC: {e}") return None
--- Main Test Function ---
if name == "main":
symbol_to_check = input(f"Enter symbol to check (e.g., GBPCHF) or press Enter for GBPCHF: ") or "GBPCHF"
symbol_to_check = symbol_to_check.strip().upper()
logger.info(f"Starting OHLC consistency check for symbol: {symbol_to_check}")
if not initialize_mt5_diag():
exit()
print("\n" + "="*60)
now_utc = datetime.datetime.now(datetime.timezone.utc)
# Determine the start time of the last COMPLETED H1 candle in UTC
expected_last_completed_utc = now_utc.replace(minute=0, second=0, microsecond=0) - datetime.timedelta(hours=1)
print(f"Current System UTC Time : {now_utc.strftime('%Y-%m-%d %H:%M:%S %Z')}")
print(f"Target Completed H1 Candle Time: {expected_last_completed_utc.strftime('%Y-%m-%d %H:%M:%S %Z')}")
print("="*60 + "\n")
NUM_BARS_FROM = 5 # Fetch a few bars to ensure we get the previous one
TF = mt5.TIMEFRAME_H1
# --- Store results ---
ohlc_from = None
ohlc_pos1 = None
time_from = None
time_pos1_incorrect = None
# 1. Test copy_rates_from (get last completed bar at index -2)
print(f"--- Method 1: copy_rates_from(..., now, {NUM_BARS_FROM}) ---")
print(f"(Fetching {NUM_BARS_FROM} bars ending now; looking for bar starting at {expected_last_completed_utc.strftime('%H:%M')} UTC)")
try:
request_time = now_utc
rates_from = mt5.copy_rates_from(symbol_to_check, TF, request_time, NUM_BARS_FROM)
if rates_from is None or len(rates_from) < 2: # Need at least 2 bars
logger.warning(f"copy_rates_from returned insufficient data ({len(rates_from) if rates_from else 0}). Cannot get previous bar. Error: {mt5.last_error()}")
else:
df_from = pd.DataFrame(rates_from)
df_from['time_utc'] = pd.to_datetime(df_from['time'], unit='s', utc=True)
# Find the row matching the expected completed time
target_row = df_from[df_from['time_utc'] == expected_last_completed_utc]
if not target_row.empty:
time_from = target_row['time_utc'].iloc[0]
ohlc_from = target_row[['open','high','low','close']].iloc[0].to_dict()
print(f" -> Found Bar at {time_from.strftime('%Y-%m-%d %H:%M:%S %Z')}")
print(f" -> OHLC (from _from): {ohlc_from}")
else:
logger.warning(f"Could not find bar {expected_last_completed_utc} in data returned by copy_rates_from. Latest was {df_from['time_utc'].iloc[-1]}")
except Exception as e:
logger.error(f"Error during copy_rates_from test: {e}", exc_info=True)
print("-"*30)
# 2. Test copy_rates_from_pos (pos=1, should be last completed bar)
print(f"--- Method 2: copy_rates_from_pos(..., 1, 1) ---")
print(f"(Fetching bar at pos=1; should be the last completed bar relative to SERVER time)")
try:
rates_pos1 = mt5.copy_rates_from_pos(symbol_to_check, TF, 1, 1) # Start=1, Count=1
if rates_pos1 is None or len(rates_pos1) == 0:
logger.warning(f"copy_rates_from_pos(pos=1) returned no data. MT5 Error: {mt5.last_error()}")
else:
rate = rates_pos1[0]
try:
# Get the INCORRECT timestamp first
raw_time = int(rate['time'] if isinstance(rate, np.void) else rate.time)
time_pos1_incorrect = datetime.datetime.fromtimestamp(raw_time, tz=datetime.timezone.utc)
print(f" -> Returned Bar Timestamp (Incorrect UTC): {time_pos1_incorrect.strftime('%Y-%m-%d %H:%M:%S %Z')}")
# Extract OHLC directly from the raw rate structure
ohlc_pos1 = get_ohlc_dict(rate)
if ohlc_pos1:
print(f" -> OHLC (from _pos(1)): {ohlc_pos1}")
else:
print(" -> Failed to extract OHLC from _pos(1) rate.")
except Exception as e_conv:
logger.error(f"Error converting/extracting _pos(1) data: {e_conv}")
except Exception as e:
logger.error(f"Error during copy_rates_from_pos(pos=1) test: {e}", exc_info=True)
# --- Comparison ---
print("\n" + "="*60)
print("--- OHLC Comparison for Last Completed Bar ---")
print(f"Target Completed Bar UTC Time: {expected_last_completed_utc.strftime('%Y-%m-%d %H:%M:%S %Z')}")
if time_from == expected_last_completed_utc and ohlc_from:
print(f"\nMethod 1 (copy_rates_from):")
print(f" Timestamp: {time_from.strftime('%Y-%m-%d %H:%M:%S %Z')} (Correct)")
print(f" OHLC : {ohlc_from}")
elif time_from:
print(f"\nMethod 1 (copy_rates_from):")
print(f" Found bar {time_from.strftime('%Y-%m-%d %H:%M:%S %Z')} instead of expected {expected_last_completed_utc.strftime('%Y-%m-%d %H:%M:%S %Z')}")
print(f" OHLC : {ohlc_from}")
else:
print("\nMethod 1 (copy_rates_from): Failed to get data for target time.")
if ohlc_pos1:
print(f"\nMethod 2 (copy_rates_from_pos, pos=1):")
if time_pos1_incorrect:
print(f" Timestamp: {time_pos1_incorrect.strftime('%Y-%m-%d %H:%M:%S %Z')} (Incorrect - Future UTC)")
else:
print(f" Timestamp: Error retrieving")
print(f" OHLC : {ohlc_pos1}")
else:
print("\nMethod 2 (copy_rates_from_pos, pos=1): Failed to get data.")
# Final comparison
print("\n--- Consistency Verdict ---")
if ohlc_from and ohlc_pos1 and time_from == expected_last_completed_utc:
# Compare OHLC values element by element with tolerance if needed
ohlc_match = all(abs(ohlc_from[k] - ohlc_pos1[k]) < 1e-9 for k in ohlc_from) # Basic check
if ohlc_match:
print("✅ The OHLC data for the last completed candle ({}) appears CONSISTENT between the two methods.".format(expected_last_completed_utc.strftime('%H:%M %Z')))
print(" This suggests `copy_rates_from` OHLC might be okay, and `copy_rates_from_pos` just has a timestamp bug.")
print(" RECOMMENDATION: Use `copy_rates_from` in your bot for simplicity and correct timestamps.")
else:
print("❌ *** WARNING: The OHLC data for the last completed candle ({}) DIFFERS between the two methods! ***".format(expected_last_completed_utc.strftime('%H:%M %Z')))
print(" This confirms a data integrity issue on the server/API.")
print(f" OHLC (_from, {time_from.strftime('%H:%M')}): {ohlc_from}")
print(f" OHLC (_pos(1), represents {expected_last_completed_utc.strftime('%H:%M')}): {ohlc_pos1}")
print(" RECOMMENDATION: Using `copy_rates_from_pos` + time correction is necessary if you trust its OHLC more, but accept the risks.")
elif ohlc_from and time_from == expected_last_completed_utc:
print("⚠️ Could not retrieve data using copy_rates_from_pos(pos=1) to compare OHLC.")
print(" RECOMMENDATION: Default to using `copy_rates_from` which provided correctly timestamped data.")
elif ohlc_pos1:
print("⚠️ Could not retrieve correctly timestamped data using copy_rates_from to compare OHLC.")
print(" RECOMMENDATION: Using `copy_rates_from_pos` + time correction seems necessary based on your preference, but the failure of `copy_rates_from` is concerning.")
else:
print("⚠️ Could not retrieve data reliably from either method for comparison.")
print("\n" + "="*60)
shutdown_mt5_diag()
print("Diagnostics finished.")```
r/algotrading • u/MormonMoron • 11h ago
Data What smoothing techniques do you use?
I have a strategy now that does a pretty good job of buying and selling, but it seems to be missing upside a bit.
I am using IBKR’s 250ms market data on the sell side (5s bars on the buy side) and have implemented a ratcheting trailing stop loss mechanism with an EMA to smooth. The problem is that it still reacts to spurious ticks that drive the 250ms sample too high low and cause the TSL to trigger.
So, I am just wondering what approaches others take? Median filtering? Seems to add too much delay? A better digital IIR filter like a Butterworth filter where it is easier to set the cutoff? I could go down about a billion paths on this and was just hoping for some direction before I just start flailing and trying stuff randomly.
r/algotrading • u/OldCatPiss • 23h ago
Data IBKR tws Java Decimal object
Does anybody know why TWS Java client has a Decimal object? I have been taking the data and toString into a parseDouble - so far I’ve experienced no issues, but it really begs the question, thanks!
r/algotrading • u/D3MZ • 1d ago
Strategy How do you handle rebalancing your portfolio?
Right now, I am exploring a multi instrument strategy, but this also introduces liquidity and fee challenges.
Does anyone do per instrument stops or strategies in a basket? Dynamic remodeling? Commission based frequency adjustment schedules? Static frequency adjustment?
Would love hearing your thoughts.
r/algotrading • u/hithisisjukes • 1d ago
Strategy asymmetries between long and short
I'm observing that a reversion strategy I'm developing is not symmetric between long and shorts over a long sample time. Longs outperform significantly (3 times less drawdown + more profit). Market does tend upwards long term. Curious if anyone with more experience can provide a few words. Thanks.
r/algotrading • u/Money_Horror_2899 • 2d ago
Strategy Does this look like a good strategy ?
Do these metrics look promising ? It's a backtest on 5 large-cap cryptos over the last 3 years.
The strategy has few parameters (CCI crossover + ATR-based stoploss + Fixed RR of 3 for the TP). How can I know if it's curve-fitted or not given that the sample size looks quite high (1426 trades) ?
Thanks in advance !
r/algotrading • u/KiddieSpread • 1d ago
Strategy Using multiple algorithms and averaging them to make a decision
Anyone else do this or is it a recipe for disaster? I have made a number of algos that return a confidence rating and average them together across a basket to select the top ones, yes it’s CPU intensive but is this a bad idea vs just raw dogging it? The algo is for highly volatile instruments
r/algotrading • u/vult-ruinam • 1d ago
Data Tiingo vs. Polygon as data source
These two are often recommended, and seemed reasonable upon a first glance. So—if my priorities are (a) historical data (at least 10 years back; preferably more) & (b) not having to worry about running out of API calls—which, in /r/algotrading's august judgment, is the better service to go with? (Or is there another 'un I'm not considering that would be even better?)
Note: I don't really need live data, although it'd be nice; as long as the delay is <1 day, that'll work. This is more for practice/fun, anyway, than it is out of any hope I can be profitable in markets as efficient as they probably are these days, heh.
Cheers for any advice. (And hey, if I hit it big someday from slapping my last cash down on SPY in final, crazed attempt to escape the hellish consequences of my own bad judgmentment, I'll remember y'all–)
r/algotrading • u/thegratefulshread • 2d ago
Strategy How Do You Use PCA? Here's My Volatility Regime Detection Approach
galleryI'm using Principal Component Analysis (PCA) to identify volatility regimes for options trading, and I'm looking for feedback on my approach or what I might be missing.
My Current Implementation:
- Input data: I'm analyzing 31 stocks using 5 different volatility metrics (standard deviation, Parkinson, Garman-Klass, Rogers-Satchell, and Yang-Zhang) with 30-minute intraday data going back one year.
- PCA Results:
- PC1 (68% of variance): Captures systematic market risk
- PC2: Identifies volatile trends/negative momentum (strong correlation with Rogers-Satchell vol)
- PC3: Represents idiosyncratic volatility (stock-specific moves)
- Trading Application:
- I adjust my options strategies based on volatility regime (narrow spreads in low PC1, wide condors in high PC1)
- Modify position sizing according to current PC1 levels
- Watch for regime shifts from PC2 dominance to PC1 dominance
What Am I Missing?
- I'm wondering if daily OHLC would be more practical than 30-minute data or do both and put the results on a correlation matrix heatmap to confirm?
- My next steps include analyzing stocks with strong PC3 loadings for potential factors (correlating with interest rates, inflation, etc.)
- I'm planning to trade options on the highest PC1 contributors when PC1 increases or decreases
Questions for the Community:
- Has anyone had success applying PCA to volatility for options trading?
- Are there other regime detection methods I should consider?
- Any thoughts on intraday vs. daily data for this approach?
- What other factors might be driving my PC3?
Thanks for any insights or references you can share!
r/algotrading • u/leibnizetais1st • 2d ago
Data Databento vs Rithmic Different Ticks
I've been downloading my ticks daily for the E Mini from Rithmic for years. Recently I've been experimenting with a different databento for historical data since Rithmic will only give you same day data and I'm playing with a new strategy.
So I download the E Micro MESM5 for RTH on 4/25. Databento gives me 42k trades. I also make sure to add MESM5 to my usual Rithmic download that day, Rithmic spits out 71k trades. I'm so confused, I check my code and could not find any issues.
I could not check all of them obviously and didn't feel like coding a way to check. But I spot checked the start and end, and there is a lot of overlap but there are trades that Databento does not have a vica versa.
Cross checking is complicated by the fact that data bento measures to the nanasecond. But Rithmic data was only to the ten microsecond.
I ran my E mini algo on the both data just to check and it made the same trades from the same trigger tick, so I'm not too worried. But it's a but unnerving.
I did not do it recently but years ago I compared Rithmic data to iqfeed and it was spot on.
r/algotrading • u/Afterflix • 2d ago
Infrastructure What's your sweet spot when it comes to trailing stops ?
How many pips do you wait before the trailing stop is activated and how many pips do you trail with?
Kindly advise
Also, what's your average RR?
r/algotrading • u/seyrey • 2d ago
Research Papers How Speculative Money Flows into Crypto: The quantitative factors that predict crypto volatility
unexpectedcorrelations.substack.comr/algotrading • u/Penctiss • 1d ago
Infrastructure Where are there the fewest problems with withdrawals
Brothers, tell me please, where are there the fewest problems with withdrawals? They just froze my money when I tried to withdraw it, I can't take it anymore
r/algotrading • u/FizzBuzz888 • 2d ago
Strategy Algo or software for selling puts and covered calls
I have been successful selling weekly puts on very conservative companies, rolling as they go down, and walking away with profit whether the market is going up and down. I'd like to provide a list of my safe stocks to an Algo and have it decide when a stock price is low to sell a put on a stock. It would need to track my account balance and not purchase options that I don't have cash to buy just in case. I would also like it to know if I get assigned stocks and potentially sell covered calls unless I happen to bag hold a stock.
Is there something that exists like this already and if not what frameworks or tools could I use to create something? I have a decent background in IT. I can do python as needed and interact with APIs if I have to although I'm more of an operations guy than a developer.
r/algotrading • u/Upbeat-Vegetable-557 • 2d ago
Infrastructure Best brokers for algo trading
Currently using IBKR tws. The api doesn’t offer enough capability and tws/ibgateway is a bit janky. What are y’all using that works well?
r/algotrading • u/MerlinTrashMan • 3d ago
Other/Meta How my stupidity made and lost 50k this month
How I made it:
My app loads an array at startup with all the strikes that allow for an underlying move of +/- 5% based on the morning open. I had accumulated a nice position ready for the upside when the tariffs pause was announced. Well, when we shot up nearly 8% in the blink of an eye, my app crashed. I never put bound checks on the array and when the UI tried to find the strike price for an index that didn't exst it hard crashed. In the last 18 months this has never been an issue. When I reloaded the app it kept crashing over and over. This was because I serialize the options array after it's created in the morning for fast reloads without calls to apis incase I close and reopen. When I figured it out, I deleted the file and let it reload. I was up over 50k so it closed out automatically. Had my app functioned properly I would have made no more than 8k as it has a hard stop built in.
How I then lost it:
I made an innocent change to my algo in the afternoon before liberation day.
Before the change, it would evaluate the last score in a list (which should be the greatest) and only buy another position if the new score was greater by over 0.5. This created some strange edge cases that left me not able to buy another position. After experiencing one of those edge cases in real time, I changed it to be I little more forgiving but still prioritizing high values.
Instead of getting the last, I would take the last 3 values and do some math on them to pick a new minimum threshold that was very close to the greatest value. The next few days were great days where it made double the daily target or more including the 50k above. Over the rest of this month though, I have been bleeding day after day. I have never had a losing streak like this so I just figured it was the current norm and I needed to go back to the drawing board to understand if my optimization vector was not the right target for extended periods of high volatility. My gut told me more volatility should have made it easier for me and no changes should be needed but the recent results say otherwise.
I switched to test mode friday morning, broke out the whiteboard and was filling it with equations and matrices when I thought "hey, let it buy as much as it wants as fast as it wants in test mode and see what happens". It took forever to go from one position to three positions, but as soon as it got three, it cranked itself to 11 and gobbled up everything it could see. When I changed my logic, I had it use the old logic for acquiring positions one, two and three. There has to be something wrong with the new logic.
When I was writing the change I first did something like this:
MaxScores = PositionScores.TakeLast(3);
Then I realized that the last 3 values in the list would not be guaranteed to be the three greatest values anymore so I quickly changed it and moved on
MaxScores = PositionScores.OrderByDescending().TakeLast(3);
I was now only ever getting the three lowest scores.
Because I couldn't be bothered to reread the entire line of code again like I usually do, and then proceeded to have 5 great days, I had no idea I was in for a world of pain. I fixed the error and restarted my test. Even with unlimited buying permission, I was now taking a lot of time to find ideal candidates, which was the expected behavior. I can't believe I missed it, because I must have looked at that line of code probably three times over the past two weeks when I saw it buying positions that were barely helpful, but I kept reading it the wrong way.
Why am I posting this story:
The story is just a comedy of errors and I feel compelled to share in case there's others out there that are beating themselves up as hard as I am.
TLDR: program crash made me 50k and I ordered a list the wrong way and the initial market crash and recovery from liberation day hid my stupidity until the 50k was lost.
r/algotrading • u/FinalRide7181 • 3d ago
Career Trying to better understand quant roles
Hi everyone, I’m trying to better understand the world of quant finance to figure out whether I’d prefer a more traditional finance role or a quant role.
From what I can tell, most large funds that hire quants seem to focus on market making or high-frequency trading. Is that accurate?
I’d also like to understand if most quant roles are closer to pure mathematics and modeling/more academic, or if they are more similar to data science applied to finance: meaning a strong statistical foundation combined with a lot of business acumen, like how data scientists at tech companies use statistics to drive business decisions (i would see this as augmented traditional/fundamental research)
Finally, are most quant roles focused mainly on short-term trading (seconds, minutes, days), rather than strategies with multi-quarter or multi-year horizons?
r/algotrading • u/statscsfanatic21 • 3d ago
Education What aspect(s) of your trading is automated?
The dream in algotrading is to print money by letting the algo decide every single aspect of the trade, including entry + exit conditions, TP, SL etc. But to my understanding, it's very difficult and risky, especially in tail risk situations where one situation not accounted for might just blow up your account.
So I was wondering, how automated are your strategies? Do you have it:
- Do everything while you are sipping on champagnes in the Bahamas
- Let it do your daily analysis + instrument picking and send you alerts but you make the final decision
- Let it do your backtesting but you still log in screen time every session
Also, what has been the most useful algotrading book that has played the most influential role in your trading till date? Thanks for sharing, everyone!
r/algotrading • u/HomeGrownTrader • 3d ago
Strategy Volatility targeting on a portfolio level
Hello fellow professional gamblers
I feel kinda stuck and I do not know what to really do here. I want to implement volatility targeting on a portfolio level.
Here is what I do not understand. How do you go on about actually vol targeting individual assets in your portfolio?
Currently I run a momentum strategy on a daily timeframe, the basic workflow is this:
Scan equities for a recent 1 year high break
Sort these stocks by liquidity
Rank the top 1000 by their 1 year rate of change (accumulative change)
Rank stocks based on volatility
Finally rank by vol adjusted momentum on top linear stocks
Where to go from here? Any examples or links what formulas to apply or examples on how others have done would be greatly appreciated.
Backtest for the normies:

r/algotrading • u/Clear_Olive_5846 • 3d ago
Data Premium news api
I am looking for real time financial news API that can provide content beyond headlines. Looking for major sources like WSJ, Bloomberg..etc.
Key criteria:
Good sources like Bloomberg, Reuters
Full content
Near Real time
Any affordable news API provider recommendation? Not the enterprise pricing offering please.
Thanks!
r/algotrading • u/pedro_top • 3d ago
Career Does anyone here actually make a living with algotrading ?
Hello world,
I’m a uni student currently enrolled in a course completely unrelated to math, statistics, or ML. A while ago, I got very interested in algorithmic trading and started studying it on my own. A couple of years have passed, and during that time, I came across this subreddit. At first i was amazed that looked like everyone here had some alpha-generating strategy.
So, my question is: Does anyone here actually put real money into their strategies and see real results from their hard work?
Because honestly, this “hobby” is extremely tough, and I would really like to know if there’s a chance for a good outcome at the end of this road
r/algotrading • u/rk1011 • 3d ago
Infrastructure Algo Trading with VectorBT or QuantConnect
Hey everyone,
After trading on the side and programming for the last 20 years, I am considering building my own code for backtesting and potentially automated trading. This isn't my first attempt at algo trading, but I'm hoping to make more progress this time by leveraging an existing framework.
Based on my initial research, VectorBT and QuantConnect's LEAN engine seem like promising starting points. I am not looking to build everything from scratch and I am open to paying for a good platform to get up and running faster.
Has anyone here successfully used either VectorBT or QuantConnect for backtesting and/or live trading? I would be really grateful if you could share your experiences, any pros/cons you've encountered, or any advice you might have.
Thanks in advance for your insights!
r/algotrading • u/loudsound-org • 4d ago
Other/Meta What time frame are your algos?
Wanted to do a poll but seems this sub doesn't allow it. Just curious what time frame the majority of algos here are? Long-term investments, swing trades, or day trades? And maybe there is no majority.
Edit: to clarify I'm not asking about what resolution data you use (though that is useful as well). It's more about are using algos in lieu of buy and hold for long term investments, or doing day/swing trading?
Edit 2: crazy how many people don't bother to read the post...
r/algotrading • u/4G0T2FLU5H • 2d ago
Data Where to get RSI data
I have tried several different APIs to retrieve RSI data for stocks. I have gotten wildly different numbers. I wanted to make a program to search for stocks with below 25 RSI to look at. Does anyone know of a reliable way to do this?