03 Mar Using A.I. To Build a Nice Strategy
Using A.I. To Build a Nice Strategy
Mar. 3, 2025
Subscribe to my YouTube Channel HERE.
Everyone tells us that Artificial Intelligence is the future of humanity.
I’m not so sure.
I think it will be around in some form or another going forward, but I’m not gaga over it.
Finding easy, creative ways to create more hollow YouTube videos is not the reinvention of the wheel. Having AI write all my high school and college papers is not how I become a smarter person.
I look at it like the internet.
Was the internet the best thing ever invented? Absolutely not. It’s horrifyingly bad and useless in many ways.
But is the internet going to be around forever? Probably.
Same for AI.
And that’s not to say I don’t use ChatGPT for research. I’ve never used it for a YouTube video or a Newsletter, but I have used it for some things–and it’s kind of fun.
But one thing people are really interested in is the ability for AI to pick stocks and/or create strategies. Can it do it?
I thought I’d check it out.
So I asked ChatGPT to build me an automated strategy. I wanted it to be simple because I’ve seen many, many complicated strategies go kaput in the past year or so.
And I wanted it to be momentum-based. Why? Because momentum will be around forever.
That said, I asked it to create a monthly momentum strategy for SPY. If the momentum was strong at the end of a month, I buy. When momentum stalled out, I sell. Many strategies use this methodology and I’m currently tracking a momentum-based rotation strategy that’s beating the market by over 2x since last September. (We’ve talked about it before and we can talk about it again, if you like.)
In a few seconds, ChatGPT had my strategy. Woohoo!
So I put it on a Monthly chart of SPY without doing any optimizing, and here are some trade examples:
And here is the Equity Curve trading $10k of stock each time since 1993:
That’s pretty fantastic-looking. Here’s the Report:
Also good.
Last, here’s how ChatGPT explains this strategy:
“This EasyLanguage code implements a simple momentum-based trading strategy using a moving average crossover approach. Here’s what it does, step by step:
-
Inputs (User-Defined Parameters):
MomentumLength(12)
: Defines the number of months used to calculate momentum (default: 12 months).AverageLength(6)
: Defines the number of months used for the moving average of momentum (default: 6 months).
-
Variables Used:
MomentumValue
: Stores the momentum calculation.MomentumAverage
: Stores the moving average of momentum.
-
Momentum Calculation:
MomentumValue = Close - Close[MomentumLength];
- This calculates the momentum by subtracting the closing price from 12 months ago from the current close.
-
Momentum Moving Average:
MomentumAverage = Average(MomentumValue, AverageLength);
- This calculates the 6-month moving average of the momentum values.
-
Entry Condition (Buying Rule):
if MomentumValue > MomentumAverage then
- If the momentum is greater than its moving average, this signals an uptrend.
if MarketPosition = 0 then Buy next bar at market;
- If no position is currently held (
MarketPosition = 0
), a buy order is placed on the next bar at market price.
- If no position is currently held (
-
Exit Condition (Selling Rule):
if MomentumValue < MomentumAverage then
- If the momentum falls below its moving average, this signals a downtrend.
if MarketPosition = 1 then Sell next bar at market;
- If a long position is currently held (
MarketPosition = 1
), it is sold at market price on the next bar.
- If a long position is currently held (
Summary:
- This is a trend-following strategy that buys when momentum is rising and sells when momentum weakens.
- It uses a momentum moving average crossover to generate trade signals.
- The strategy assumes a monthly time frame, as the momentum calculation uses past months’ prices.
- Works best in trending markets, but may struggle in sideways or choppy conditions.”
Elite members can get the fully-implemented code in the form of an ELD for free.
Overall, is ChatGPT useful? Possibly.
It can definitely do simple things well and can do them in a fraction of the time it would take to code something manually.
It has really struggled, though, to make complicated strategies. I haven’t been able to make one yet.
Is it the future of trading?
Not entirely.
But it can be a really nice tool to have in your arsenal.
Talk to you soon.
Join the free Newsletter list here .
Get Robot information HERE.
Visit my Performance Page HERE.
Buy my new book HERE.
The Inevitability of Becoming Rich is HERE.
My latest YouTube video is HERE.
Disclaimer:
It should not be assumed that the methods, techniques, or indicators presented in these products will be profitable or that they will not result in losses. Past results are not necessarily indicative of future results. Examples presented on these sites are for educational purposes only. These set-ups are not solicitations of any order to buy or sell. The authors, the publisher, and all affiliates assume no responsibility for your trading results. There is a high degree of risk in trading.
HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT ACTUALLY BEEN EXECUTED, THE RESULTS MAY HAVE UNDER- OR OVER-COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN.