Gain access to exclusive tools that Wall Street's Elite don't want you to have. Don't miss the next issue...
Join 11,500+ Quant Scientists learning one article at a time
Join 11,500+ Quant Scientists learning one article at a time
Today, we are sharing some of the progress we've been making on the course. Our goal is to take you end-to-end from installing the Python Quant Scientist Stack all the way through submitting trades. And today, we are sharing a prototype that covers:
Creating a stock scanner
Identifying a list of equites to trade
Using quantitative portfolio construction to build a volatility targeted portfolio using our proprietary Python Quant Scientist Stack
Calculate optimal weights based on portfolio value
BONUS: Automatically send those trades to our Interactive Brokers Trader Workstation from Python 👇
Want exclusive access to the FULL codebase for this Quant Science tutorial plus dozens more? Then:
This post comes with an 8 minute video tutorial showcasing everything we cover in this tutorial.
We'll use openbb
to import a list of stock tickers. The screener will search for stocks with new high prices greater than 15 and within the USA. We then collect the stock prices from our desired time range. And we convert from prices to percentage returns.
This gives us the stock returns for 119 equities.
We'll use Riskfolio
to do computational analysis and produce a constrained portfolio.
This produces the portfolio weights for our Volatility Weighted Portfolio.
Next, we just need to get the number of shares to trade which we can see in the 4th column ("shares").
Now we just need to iterate through each of these to place the trades. We will walk through this in the course, but just recognize that we can convert the portfolio's shares to Interactive Brokers contracts and place the orders.
The last step is to connect to the Interactive Brokers (IB) API. This will allow us to place the trades via IB Contracts.
We can quickly check that we are now connect to the Interactive Brokers Trader Workstation via the API connection.
The last thing we do is submit the orders to Interactive Brokers. We run this Python code:
We have just submitted 119 orders. Not all of the orders will be filled, but we can see that the grayed out assets have been filled along with their fill price.
This is what we are working on. The idea is to take you from Ground Zero all the way to where you can automatically submit trades, manage risk, and use Python with Interactive Brokers all from start to finish.
There's nothing worse than going at this alone--
❌ Learning Python is tough.
❌ Learning Trading is tough.
❌ Learning Math & Stats is tough.
It's no wonder why it's easy to feel lost.
And all of this increases the likelihood you will fail (not to mention lose money in the process). Protect your future.
👉 Join 800+ future Quant Scientists on our Python for Algorithmic Trading Course Waitlist: https://learn.quantscience.io/python-algorithmic-trading-course-waitlist
Gain access to exclusive tools that Wall Street's Elite don't want you to have. Don't miss the next issue...
Join 11,500+ Quant Scientists learning one article at a time
Join 11,500+ Quant Scientists learning one article at a time