Basic gap trading noscript with AI
Just wanted to post my code for a basic start used on Quantconnect. In backtests it hasn't made a profit so any feedback will be greatly appriciated. I was thinking of connecting it to Gemini to help approve trades with high confidence.
https://pastebin.com/REQQYjB8
https://redd.it/1q0rzrs
@r_algotrading
Just wanted to post my code for a basic start used on Quantconnect. In backtests it hasn't made a profit so any feedback will be greatly appriciated. I was thinking of connecting it to Gemini to help approve trades with high confidence.
https://pastebin.com/REQQYjB8
https://redd.it/1q0rzrs
@r_algotrading
Pastebin
Gap Trading Algo - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Update with performance stats for my year's algo trading
Hi all,
For those that are interested, here are the raw performace numbers for my algo trading model. Make of these what you will. Broker is Fusion Markets (zero 'Pro' account, with leverage up to 500:1) - the other type of account, I believe called spreads is completely incompatible with this type of trading and would erode all profitability, as the spreads are far wider, with zero commission (confusing I know).
|Metric|Value|
|:-|:-|
|Total Trades|1179|
|Win Rate (%)|70.19%|
|Total Net Profit (£)|£245,623.82|
|Profit Factor|1.57|
|Risk-Reward Ratio|1.70|
|TP pips (avg)|3.71|
|SL pips (avg)|5.78|
|Average Trade (£)|£208.50|
|Avg trade vs equity inc leverage|1.50%|
|Average Win (£)|£1,400.82|
|Average Loss (£)|\-£2,101.24|
|Largest Win (£)|£5,766.39|
|Largest Loss (£)|\-£4,206.32|
|% equity expectancy per trade|0.65|
|£ equity expectancy per trade|£216.92|
|Avg commission|£143.59|
|Avg time open (min)|12.27|
|Max Drawdown (%)|\-13.43%|
|CAGR (%)|47.89%|
|Annual Volatility (%)|29.19%|
|Sharpe Ratio|2.26|
|Sortino Ratio|2.76|
|Max Consecutive Losses|4|
|Max Consecutive Wins|8|
|Worst Day £|\-£6,303.71|
|Best Day £|£11,208.17|
https://redd.it/1q19gw5
@r_algotrading
Hi all,
For those that are interested, here are the raw performace numbers for my algo trading model. Make of these what you will. Broker is Fusion Markets (zero 'Pro' account, with leverage up to 500:1) - the other type of account, I believe called spreads is completely incompatible with this type of trading and would erode all profitability, as the spreads are far wider, with zero commission (confusing I know).
|Metric|Value|
|:-|:-|
|Total Trades|1179|
|Win Rate (%)|70.19%|
|Total Net Profit (£)|£245,623.82|
|Profit Factor|1.57|
|Risk-Reward Ratio|1.70|
|TP pips (avg)|3.71|
|SL pips (avg)|5.78|
|Average Trade (£)|£208.50|
|Avg trade vs equity inc leverage|1.50%|
|Average Win (£)|£1,400.82|
|Average Loss (£)|\-£2,101.24|
|Largest Win (£)|£5,766.39|
|Largest Loss (£)|\-£4,206.32|
|% equity expectancy per trade|0.65|
|£ equity expectancy per trade|£216.92|
|Avg commission|£143.59|
|Avg time open (min)|12.27|
|Max Drawdown (%)|\-13.43%|
|CAGR (%)|47.89%|
|Annual Volatility (%)|29.19%|
|Sharpe Ratio|2.26|
|Sortino Ratio|2.76|
|Max Consecutive Losses|4|
|Max Consecutive Wins|8|
|Worst Day £|\-£6,303.71|
|Best Day £|£11,208.17|
https://redd.it/1q19gw5
@r_algotrading
Reddit
From the algotrading community on Reddit
Explore this post and more from the algotrading community
Choosing uni degree as a student who wants to be a algo-trader
I want to be a trader and I will be starting my projects in university. However, I dont know how to choose my degree. I was thinking that I need to choose an easy one to focus on my projects such as economics otherwise I want to choose computer science but it will take my time and I will not be able to focus on my trading journey
https://redd.it/1q199kd
@r_algotrading
I want to be a trader and I will be starting my projects in university. However, I dont know how to choose my degree. I was thinking that I need to choose an easy one to focus on my projects such as economics otherwise I want to choose computer science but it will take my time and I will not be able to focus on my trading journey
https://redd.it/1q199kd
@r_algotrading
Reddit
From the algotrading community on Reddit
Explore this post and more from the algotrading community
Would you be interested in an API for politician/insider trades?
https://redd.it/1q22nt4
@r_algotrading
https://redd.it/1q22nt4
@r_algotrading
I Built a Market Stability Dashboard - 10 Indicators Tracking Market Health Across 6 Domains --
Hey everyone! I just launched a market analysis side project and would love some feedback.
About me / disclaimer: I’m not a finance professional, just a designer who hyperfixated on building a more human-readable way to gauge market and economic “health.” This is a vibe-coded context tool, not investment advice, predictions, or signals. Mostly posting to get smarter eyes on it and see what I’m missing. I wanted something transparent that blends multiple signals into an empathic context without pretending to predict the market.
What it is
The Market Diagnostic Dashboard is a real-time tool that tracks \~10 indicators across six domains to give a high-level snapshot of overall market stability:
Volatility & Equity: VIX, SPY
Rates & Curve: Fed Funds Rate, 10Y–2Y
Employment: U.S. Unemployment
Bonds: Credit spreads, curve dynamics, Treasury volatility
Liquidity: M2 growth, Fed balance sheet, RRP usage
Sentiment: Analyst, consumer, and corporate sentiment
Each indicator is scored 0–100 (higher = healthier) and combined into a weighted composite that classifies conditions as GREEN (stable), YELLOW (caution), or RED (stress).
What it includes
Live data from FRED + Yahoo Finance + Seeking Alpha
1 year of historical context with charts
Dow Theory–based market strain analysis
Market news for a custom ticker list + full methodology docs
Free, no ads/paywalls. Only using publically available data to draw conclusions.
Would love thoughts on
Indicators to add/remove
Sanity check on if my current indicators measure viable stats/trends
Whether the weighting makes sense (it’s a bit vibe-based)
How you’d actually use this
Bugs or UX issues
Pictures:
main dashboard page
Market Map page
A breakdown of the entire system and their algorithms
Would love to hear what you think!
https://redd.it/1q23pch
@r_algotrading
Hey everyone! I just launched a market analysis side project and would love some feedback.
About me / disclaimer: I’m not a finance professional, just a designer who hyperfixated on building a more human-readable way to gauge market and economic “health.” This is a vibe-coded context tool, not investment advice, predictions, or signals. Mostly posting to get smarter eyes on it and see what I’m missing. I wanted something transparent that blends multiple signals into an empathic context without pretending to predict the market.
What it is
The Market Diagnostic Dashboard is a real-time tool that tracks \~10 indicators across six domains to give a high-level snapshot of overall market stability:
Volatility & Equity: VIX, SPY
Rates & Curve: Fed Funds Rate, 10Y–2Y
Employment: U.S. Unemployment
Bonds: Credit spreads, curve dynamics, Treasury volatility
Liquidity: M2 growth, Fed balance sheet, RRP usage
Sentiment: Analyst, consumer, and corporate sentiment
Each indicator is scored 0–100 (higher = healthier) and combined into a weighted composite that classifies conditions as GREEN (stable), YELLOW (caution), or RED (stress).
What it includes
Live data from FRED + Yahoo Finance + Seeking Alpha
1 year of historical context with charts
Dow Theory–based market strain analysis
Market news for a custom ticker list + full methodology docs
Free, no ads/paywalls. Only using publically available data to draw conclusions.
Would love thoughts on
Indicators to add/remove
Sanity check on if my current indicators measure viable stats/trends
Whether the weighting makes sense (it’s a bit vibe-based)
How you’d actually use this
Bugs or UX issues
Pictures:
main dashboard page
Market Map page
A breakdown of the entire system and their algorithms
Would love to hear what you think!
https://redd.it/1q23pch
@r_algotrading
2nd year physics student looking to build an algo
Hey, I'm an undergrad doing physics and I found this sub recently & got pretty interested. I'd like to try and build an algo.
What math should i learn specifically, like what level should i reach. Since I'm still in my second year i know i lack a lot but I don't mind getting ahead a little and learning.
And what about economics?
Are there any ressources you can recommend for me? thanks!
https://redd.it/1q288gg
@r_algotrading
Hey, I'm an undergrad doing physics and I found this sub recently & got pretty interested. I'd like to try and build an algo.
What math should i learn specifically, like what level should i reach. Since I'm still in my second year i know i lack a lot but I don't mind getting ahead a little and learning.
And what about economics?
Are there any ressources you can recommend for me? thanks!
https://redd.it/1q288gg
@r_algotrading
Reddit
From the algotrading community on Reddit
Explore this post and more from the algotrading community
Quantconnect is trash any alternatives?
Quantconnect just keeps becoming more trash by the day, to the point that now the same exact algorithm that worked fine before doesn’t place orders anymore…
Any decent reliable alternatives? Or is it time to roll up my own infra?
Any decent libraries?
https://redd.it/1q2g56e
@r_algotrading
Quantconnect just keeps becoming more trash by the day, to the point that now the same exact algorithm that worked fine before doesn’t place orders anymore…
Any decent reliable alternatives? Or is it time to roll up my own infra?
Any decent libraries?
https://redd.it/1q2g56e
@r_algotrading
Reddit
From the algotrading community on Reddit
Explore this post and more from the algotrading community
I built a MA crossover self-optimized bot, it looks promising but not sure
I've been dabbling with some quirky bot ideas, and this is one of them. I took a very basic bot that I have and is now live and doing well, and I thought, "what if I made this bot self-optimize itself every 30 days?" That means, every 30 days, it conducts several backtests with different fast and slow moving averages values then choose the ones that have the best yield and use them for the next 30 days, then do it all over again at the end.
You can argue I'm walking a very thin line here of overfitting, but really, it's just a perpetual out-of-sample data live trading bot.
So far, the original non-self-optimizing bot has outperformed it on all major pairs, with the exception of GBPUSD:
https://preview.redd.it/1kp1w508z3bg1.png?width=1604&format=png&auto=webp&s=252bf7d2959651aa46fd14cc211b1789dbccecb6
This is a 10-years backtest where it conducted a self-optimization operation every 30 days. This shows me that... maybe there's hope? I'm not sure, what do you guys think? Could this be improved on?
https://redd.it/1q2r1s3
@r_algotrading
I've been dabbling with some quirky bot ideas, and this is one of them. I took a very basic bot that I have and is now live and doing well, and I thought, "what if I made this bot self-optimize itself every 30 days?" That means, every 30 days, it conducts several backtests with different fast and slow moving averages values then choose the ones that have the best yield and use them for the next 30 days, then do it all over again at the end.
You can argue I'm walking a very thin line here of overfitting, but really, it's just a perpetual out-of-sample data live trading bot.
So far, the original non-self-optimizing bot has outperformed it on all major pairs, with the exception of GBPUSD:
https://preview.redd.it/1kp1w508z3bg1.png?width=1604&format=png&auto=webp&s=252bf7d2959651aa46fd14cc211b1789dbccecb6
This is a 10-years backtest where it conducted a self-optimization operation every 30 days. This shows me that... maybe there's hope? I'm not sure, what do you guys think? Could this be improved on?
https://redd.it/1q2r1s3
@r_algotrading