This week I created Node Red flows for six popular options trading strategies: Iron Butterfly, Iron Condor, Bear Call Spread, Bear Put Spread, Bull Cal Spread, and Bull Put Spread. These can general steady, low risk returns in relatively quiet markets. Signup for your MachineTrader account and download from the Trading Scripts link in the home page.
You will need to get authorized for Option Trading with our broker/dealer Alpaca.
Recent advances in AI assistants have made creating and executing MachineTrader strategies in the Node-RED visual programming language even easier and faster. I’ve been experimenting with the free versions of Microsoft Copilot and Google Gemini.
If you’ve used MachineTrader before, you know the “low-code” part of the platform really comes down to working inside Node-RED function nodes, which use JavaScript. And if you’re not a JavaScript developer (I’m definitely not!), writing function nodes can get complicated.
Lately I’ve been building an automated weekly iron butterfly options strategy. The flow identifies the strongest underlying tickers and then executes the trades every Monday, selecting contracts that expire that Friday. I love the irony of a butterfly: your highest return comes when the underlying ticker finishes exactly where it started! I also prefer the limited risk associated with “selling” options with predefined “insurance” buy contracts.
(I’ll share some sample code and a breakdown in a future post.)
Here’s where Copilot and Gemini really surprised me.
I was trying to write a function node that continuously evaluates the current gain/loss on the butterfly position - a bit more complex than usual. I took a first pass at it, but my flawed code kept failing and returning null.
On a whim, I pasted the code into Gemini.
https://t.co/r0T3XJ64yU
Instantly, it generated a corrected function node.
https://t.co/4XL8ER5uwE
I copied and pasted it into a function node...and it worked perfectly.
More examples coming soon.
— Dan
🚀 Join MachineTrader & Alpaca at Tech Week:
- SF (Oct 8) & LA (Oct 15)
- Live algo builds (no Python)
- Hands-on trading via Alpaca MCP Server w/ natural language & APIs
- 90-day MachineTrader sub free!
Sign up for our free demo plan at https://t.co/wUFLERL8s8 Once you've had a look around, if you are interested in automating your trading with MachineTrader™, please join one of our free introductory/training sessions.
Thank you to @AlpacaHQ for hosting a great interview with two of our founders, Dan Savage and Jerzy Pawlowski today! For anybody who wants to learn more about us, here's the link: https://t.co/3wLf4Vmh6D