This is a quick, basic guide to help getting started with coding from a zero starting point perspective. The guide will be focused around using Visual Studio Code as editor environment.
Modeling up a 66% retrace scenario would give us SPX 4430-4440.
Roughly 350-375bp from Friday 14 close.
120bp to SMA200.
Then overshooting SMA200 with 250bp.
She needs cash to be deployed into longs and she will get it. Max emotions incoming.
@WifeyAlpha
was the one inspiring me to get started with coding. His pinned research and guides to quant coding has helped me insanely much. The guide I wrote is a complement to his pinned with a focus on getting in to productive coding with focus on the very early stage learning
Before yesterday I had basically never done a serious strategy build based off RSI or a similar common calculation. I built the 3d RSI < 30 entry and close above yesterday high exit.
The results are actually intriguing enough to have it automated in an algo portfolio.
Literally no one shouted louder than
@WifeyAlpha
on 2021-11-09 calling the market top. He has been transparent with his Pig portfolio ever since. Everything is pinned and open for anyone to grab pure alpha on his account. Stock-Bond Correlation Crisis is his quote, remember.
I will work on publishing my systems.
No paywall.
Instead I'll set up a tip jar.
- You are welcome to tip <own amount> as a token of gratitude, preferably when you profit from my systems.
No performance: I can never expect a cut. Simple.
- Yes/No?
@WifeyAlpha
It's thanks
@WifeyAlpha
and the research he provided I got into the coding part of finance and I will forever be grateful for that guidance. Now building and deploying my own programs to secure my family long term funds.
As we say, shut up and work harder (no one cares)
My normie trade last Zee Puts was selling of quite some equity exposure. Q1 was horrible but summer drift saved me, thanks to Wifey I didn't panic trade in June. This time I will increase cash further, but also rebalance portfolio into some unleveraged short positions. Godspeed.
Ok
@AlphaTruffle
lets do this.
A normie portfolio using ur coding as base and
@WifeyAlpha
Pig Portfolio as base for assets. I'll play this out like I'm a PM of 20Bn$ using this portfolio to trade almost never during the entire S/B Corr. Crisis.
I'm almost done with a complete Officer K $SPX Regime Model indicator. Everything gathered in a single indicator. Been putting some heavy time into this last couple of weeks. This is a realization of all the python regime code I did last year basically.
Strategy is now published through the link below. If you like it you know what to do🤝. This is walk forward performance transparency starting Aug 1, 2024.
📍Adding to the pinned strategies.
OKATRend SPX 1H v1 -
#SPX
TradingView
This is the Officer K Regime Model Indicator.
Built to identify bear markets, corrections (semi), bull markets, buy the dip-and sell the rip opportunities.
Regime layers combined with different indicators create a rule based prioritization for when to react.
Hey I'm just checking in. Hope you're all fine. I'm working on other projects atm and just watching/following the systems, not building so much right now as I'm busy with other priorities.
Much love,
Lodson
And hey:
NO ONE CARES (Work harder)
Big step today. Finally created a portfolio eq weight return table from scratch that is plottable, and not "copying" the code. It's all easy to get the code etc from tutorials but I'm focusing on "controlling" my coding. This will let me build systems that I have full control of.
You make shady plotshapes, shill and sell a sub to use it live.
I post clean entries, for free.
We are not the same.
(Will delete when strategy gets killed)
So this is the out of sample backtest using the strategy on NDQ/QQQ.
Trade cost 0,1% and 5 tick slippage included. It's the most interesting backtest I've generated in a veery long time.
Compare to benchmark NDQ same out of sample period (second image)...
A more in depth on the OKATrend $SPX strategy.
Literally giving away the entire strategy here. This is only the v1, we will run this in walk forward and develop on further concepts like swapping criterions to see if there's more dynamics to find.
This is the strategy with all the 1H data I can get hold of currently. The difference right now is that the Python code does not include transaction cost like TV does so the performance in Python is not as representative.
TV backtest for this strategy is now validated✅
OKATRend verified exact entries and exits for the python version to backtest strategy further.
Now there's a problem for the python code which is that for an upcoming automation I will have to verify the strategy with data from other sources.
I basically shared this strategy publicly so for anyone that wants to prove it wrong, be my guest. I'm more than happy having some of the more experienced developers test it with their input data for slippage, commission etc.
Like what's happening here? Please leave a like! 🙏
This is the strategy with all the 1H data I can get hold of currently. The difference right now is that the Python code does not include transaction cost like TV does so the performance in Python is not as representative.
TV backtest for this strategy is now validated✅
Average case scenario for a decline under the weekly timeframe 200SMA is a big trigger for selling when it finally trades below.
$SPX rarely closes below the weekly timeframe 200SMA, but when it does...
Just finished writing a quick basic "get started" guide that hopefully helps at least someone getting started with their quant coding journey. Post coming soon.
Finally, let's round this up for real by sharing the indicator yes?
Please repost and like as a token of respect for my work.
I'm not asking for any tip, it's optional and just highly appreciated:
Link to indicator:
Great first trade on the OKATrend (blue shade is live traded). We need to establish a new upgrind on the upper band in order to go long again alternatively go lower and enter on a crossover on the lower band.
Working on full automation still. Hopefully getting some outputs today
I need engagements so let's end the day with a quant larp-baiting backtest.
EqW vs a Softmax function on rolling 21d return relative momentum to SPY to determine allocation %.
Ofc no commission or slippage added yet.
Yes the return_table is .shifted().
This is a MA prod proj\
Tonight I executed my first trade through a python script via API.
I might have been too passive on confronting this end of coding before, and maybe rightfully so... The main reason was that I wanted to use a broker that allowed API integration.
I'm almost done with a complete Officer K $SPX Regime Model indicator. Everything gathered in a single indicator. Been putting some heavy time into this last couple of weeks. This is a realization of all the python regime code I did last year basically.
Lowering the ATR multiplier from 6 to 4 changed the max dd a lot. Getting more trades so backtest has a higher commission decay instead. The good part here is that I know there's no good "failsafe" exit for the real tail events like covid drawdown, thanks to the earlier version.
Working on a trend/ATR strategy for 1H candles on S&P500.
Inputs are 0.1% commission per trade and 5 tick slippage.
In sample backtest from 2012 -> today (showing in graph too).
dd profile looking really good except for covid, will work on some other exit conditions.
Currently, I'm working on setting up a dashboard using the dash lib, which I'll eventually launch publicly accessible through PythonAnywhere (or similar) using Django (or similar).
The tables and graphs showing are not static images, they'll change automatically with new data
Did some minor changes on the script. Added a plotshape for possible mean reversions (during flush chandles on the hourly) and made the bottom pane with Trend Change Oscillator a bit cleaner.
If you have it added already you might have to re-favorite it.
What if Officer K 21d would be added as an indicator?
I don't even need to post stuff anymore I'm just grinding on other projects and check regime/21d daily.
So many hours of work starting to become comprehensive. What do I call this paper? an introduction maybe.
Regime model will be shared but I can not promise I’m unlocked for it.
Modest returns but heavy on the risk management.
I'm working a lot on cleaning my code and structure now to standardize everything. Also working way more with functions and calling for functions cross files to separate different steps of the process.
Backtest using Yfinance (free) data. Entries/exits validated by the dataframe. Strategy backtest with max available data from yfinance.
This is enough for validation, because evidently, the data from yfinance is close to exact the data in TradingView.
I basically shared this strategy publicly so for anyone that wants to prove it wrong, be my guest. I'm more than happy having some of the more experienced developers test it with their input data for slippage, commission etc.
Like what's happening here? Please leave a like! 🙏
Why do I copy
@WifeyAlpha
with creating a persona around my system as well?
I like the idea that the system is someone I care for. Trades and pos are emotionless, but the system itself, I am responsible for. That makes me want to work harder for it to be as good as possible.
Added VIX signal to sniff out those "unexpected" events. Trading frequency a bit too high for my taste but this model has lots of more work to be done. But yeah, we protecting from that drawdown only thing that matters.
3 signals
Long only SPX, no leverage
Risk off = 100% cash
"Trailing stop" is the middle band, keeps raising reference. Now we see the strength of this strategy keeping the position and not getting shaken out too early.
Will be interesting seeing this walk forward during sideways market.
Full scale automation coming too.
@0xFinna
@WifeyAlpha
If market was dumping for real we should expect a lot higher VIX spike. Market dumping -120 bps looking like its gna end at -500 intraday we should see VIX spike accordingly. If VIX doesnt spike we can assume that the market wants people to jump the guns then burn them out.
Putting some
@WifeyAlpha
alpha to work 😎. Coded the rolling R/R and Hit Rate for my systems. We can mask whenever system is running a hot or cold prediction period etc. Should not be mistaken for the size of loss/gain from each position tho. 80% hitrate can get smoked by tails.
Ok LFG:
First of all I want to enforce:
This is a THEORETIC portfolio. It aims to mimic the Pig and eventual trades that CQ makes as simple as possible. To this date it has not tested how it handles being in the dark.
I'm moving fast and since my latest project with the Mimic-Pig 'Long'-only Portfolio I'm inclined to move to that portfolio and call it the 'LeChauffeur'.
Reason is that it's an extremely simple portfolio and accessible. Also it will be a lot funnier to run up with against Pig.
I'm very grateful for the big response!
I'm not expecting anything of this, I'm working for myself and my family but sharing my models is a good way to make new connections.
I will work on publishing my systems.
No paywall.
Instead I'll set up a tip jar.
- You are welcome to tip <own amount> as a token of gratitude, preferably when you profit from my systems.
No performance: I can never expect a cut. Simple.
- Yes/No?
What if I build a global algo for single tickers. Setup a discord, webhook a bucket of tickers with good performance, make algo adjustable(?) and then we can all build a community around its trades? It will be a 50-300 ticket list eventually with signals almost every day.
Just started on a new concept algo for single tickers. Same settings on all backtest, 20yrs.
Didn't explore much on different inputs yet, could be something big in the making here.
God damn didn't think I would make it in time to post it all today. Please share or like the script post (pinning it), it's highly appreciated! 🙏
Off to bed, have a good evening!
NDQ/QQQ trend strategy based on a variant of Ehler Decycler. Will make a writeup on it. First NDQ strategy, very excited for the WF.
S/O to
@AlgoTradingGuy
for making a post on trend following strategies which is where I got caught up on Ehler and wanted to explore on it.
GM everyone.
Big flop that TV took down my publications. I started publishing my scripts as private now. They will be easily accessed through the links again. I will set up a thread or similar to gather all my published systems so you can access them via my X profile.
Officer K as a system is a combined voting amongst several individual strategies ("A" to "I") based on different indexes (VIX-indexes). Officer K buy and sell SPY or SPX based on implied as well as realized volatility.
Shade is walk forward.
Lord Chadington being a Chad.
@WifeyAlpha
did so much for many of us normies. My learning curve would have been much longer if I didn't stumble upon his account. Forever grateful for getting exposure to quant coding, been such a joy. Also met lots of awesome ppl on the way.
Shared this so many times. It doesn’t matter if you have 0 prior coding experience, these lectures and tutorials make your 🧠 wire itself differently by keeping at it. Before you know it, you make progress. Don’t listen to the lil bitch (except if it’s CQ lol) and START
I'm working on setting up the monthly rebalancing machine learning core portfolio. Currently has 15 tickers with 20% gold and 80% equal weight between the 14 remaining. The model itself will have different and a more dynamic allocation so it will walk forward differently.
Some of you might think I spend all my time coding, but I shit you not, I have been working together with a close friend (also engineer) on a startup in the sports product manufacturing industry. Currently finetuning our website and getting our first prototype batch very soon.
TV basically wants code if publishing public and that’s understandable.
Way easier to publish them private and I’ll post a link thread that I can pin on my profile👍🏽
Getting the right format for my mail pusher and the automatic mail push is working as intended in the scheduler.
Holy fuck this is becoming extremely exciting now.
Next up: Set up connectivity with broker API and confirm trade execution within the scheduler.
I will receive a
Officer K Jan 2023 vs Officer K Jan 2024.
2023 was a huge year and characterized by system development. 2024 will be a year where I will keep looking for cookies but with a lot more focus on execution in the market to fully utilize my systems.
Thank you for all ur support!
Algo F and G have been the true risk managers for the complete system. While the others are more trigger happy and trying to mean revert to maximize returns, this combination of only F and G offers a relative low time in market (25%) and exceptional ability to avoid drawdowns.
60% long only SPUU (2X lev) with regime filter. Combine with vol signal for risk reduction out of regime.
40% long/short SPUU vol strat working as running hedge for tail risk events and runner out of regimes.
cc
@turintrader
I stole his code and indys😎
A leveraged 60/40 with additional 55% lev (essentially a 93/62) outperforms a 60/40 with the same volatility. This leaves an additional slice to allocate somewhere else.
The RP rec, would be to try to find an uncorr asset with positive expected return for that remaining slice.
Honestly I'm a bit hesitant to release the intras system and indicator. I feel that its such a high risk people will not be able to manage their risk.
These systems are not get rich quick solutions. They are supposed to be used preferably in conjunction with other signals.
The regime model will be a lot bigger publication than intended... I don't want to just throw it out with no descriptions or anything with it. When it's such a big system with many components there's a bunch to cover to make it comprehensive.
Imagine how many people going to lose their money simply by trusting GPT to build a system for them without any idea how to verify the validity of the backtest and just trust the signals blindly.
Imagine when all the accumulator investors can't hold their Apple shares any longer. Not because they can't stand looking at the losses, but they need cash to pay for cost of living...
Such a great feeling to have an understanding of the complete picture and end goal now compared to only a couple of months ago. I've always had a goal painted out, I just didn't know which tools I need, and finding that out has been a lot of work on stuff that isn't really
Currently, I'm working on setting up a dashboard using the dash lib, which I'll eventually launch publicly accessible through PythonAnywhere (or similar) using Django (or similar).
The tables and graphs showing are not static images, they'll change automatically with new data
Back to working some on my program. Been spending a lot of time with my new family member last month. We are all doing great etc🙏🏽
Main focus is the risk off models. I think the risk on models are basically set for Officer K.
The OKEhler 1H $NDQ / $QQQ v1 is running its first live trade from last Tuesday, L $NDQ ref 18969.
The concept of this strategy is based on a Ehler Decycler Trendline which is combined with ATR, having entries & exits around a "trend strength" output.
Not publicly released yet.
Before yesterday I had basically never done a serious strategy build based off RSI or a similar common calculation. I built the 3d RSI < 30 entry and close above yesterday high exit.
The results are actually intriguing enough to have it automated in an algo portfolio.
Long only (core) position buy and hold in and out of regime. Depending on VIX strategy 1 is bull or bear it increase to full pos or decrease to half depending if in a regime or not.
Trading systems run for themselves with no connection to regime.
3D being pretty savage last couple of trades. It’s pushing really well in walk forward so far.
Fade this shill tho everytime I do this it’s followed by a bad pos😂
Peace everyone, I’m currently in Paris, loving it here.