Canvas & Ratio
Choose your destination platform format
Layout Template
Choose a content structure for your slides
Preset Themes
Typography & Sizing
Brand Kit Customization
AGENCYConfigure brand assets for headers & footers
Outro Slide CTA
Customize your closing call-to-action slide
Background Pattern
Build Your Carousel
Drag and drop any post card below onto a slide, or use the quick buttons to insert content/images instantly!

How to make a simple algorithmic trading strategy with a 472% return using Python. A thread. 🧵


This strategy takes advantage of "flow effects", which is how certain points in time influence the value of an asset. This strategy uses a simple temporal shift to determine when trades should exit relative to their entry for monthly boundary conditions.


The signals for when to go short, when to cover shorts, when to go long, and when to close longs are all linked to these recurring monthly cycles. This periodic "flow" of signals—month-in, month-out—creates a systematic pattern.


1. Load the libraries and data Import these libraries. Then run the code to ingest price data on TLT.


2. Generate Signals We'll first set up an empty data frame to track the long/short signals. Then we create short entry signals on each new month's 1st and 5th day. Similarly, we make long signals 7 days and 1 day before the end of each month.


3. Run this code to get the Trade PnL Use vbt.Portfolio.from_signals().


Use pf.stats() to return the portfolio stats summary tear sheet.


🚨Want to learn Algorithmic Trading Strategies (that actually work)? On June 25th, we are hosting a free workshop to help you get started with algorithmic trading with Python.  Register here (500 seats): <a target="_blank" href="https://learn.quantscience.io/join" color="blue">learn.quantscience.io/join</a>


That's a wrap! Over the next 24 days, I'm sharing my top 24 algorithmic trading concepts to help you get started. If you enjoyed this thread: 1. Follow me @quantscience_ for more of these 2. RT the tweet below to share this thread with your audience <a target="_blank" href="https://twitter.com/1683526993059430411/status/2066550360546701536" color="blue">x.com/16835269930594…</a>

P.S. - Want Algorithmic Trading with Python tutorials every Sunday? Register here to join our Sunday Quant Scientist Newsletter (it's free): <a target="_blank" href="https://learn.quantscience.io/quant-scientist-newsletter-register-9614" color="blue">learn.quantscience.io/quant-scientis…</a>