HomeVideos

I Built & Backtested Trading Strategies with Claude Code

Now Playing

I Built & Backtested Trading Strategies with Claude Code

Transcript

1399 segments

0:00

Most traders are asking AI the wrong

0:02

questions. They're asking it what stock

0:05

to buy. Better question is, can you do

0:08

hundreds of hours of research for today?

0:10

We're talking with a 20-year veteran

0:13

systematic trading about how he's using

0:16

Claude to build and test trading

0:18

strategies in a fraction of the time and

0:21

why that changes what one trader can

0:23

accomplish. Welcome to episode 20 of the

0:27

trading floor podcast. Our guest today a

0:30

systematic day trader since 2005

0:33

currently trading 30 plus proprietary

0:35

strategies every day.

0:37

His name is Dave maybe founder of maybe

0:39

kit the number one strategy optimizer

0:42

and automation tool for systematic

0:43

traders host of line your own pocket

0:46

podcast former CTO of trade ideas and

0:50

he's on a mission to turn 10,000

0:52

hobbyist into full-time traders doing it

0:54

for a living. Dave, thank you for

0:56

joining us. This is the second time.

0:58

We're so psyched to have you on again.

1:01

>> Yeah, thanks so much for having me. I'm

1:02

excited to be here.

1:03

>> So Dave

1:05

as many know who have been in the bionic

1:07

meetings where Dave has joined us and

1:09

I've introduced Dave

1:11

Dave is a mentor to Tim and I when it

1:13

comes to everything automation and

1:16

everything strategy optimization. And so

1:20

when

1:21

Dave when you told me that you wanted to

1:23

come on and talk about how you're using

1:25

Claude automate backtesting and strategy

1:28

development. I got really excited

1:30

because Tim and I haven't done this yet.

1:32

So what drove you down this path?

1:36

>> Yeah, so I've got four bullet points

1:39

that you know, I've been listening to

1:40

your podcast. You guys have been doing a

1:42

great job with this and so to inspire me

1:45

to to think about this.

1:47

Um,

1:48

you know, I've always

1:50

I've always automated stuff like if from

1:54

the career I had before trading

1:56

Uh, I was all about automating stuff and

2:00

it's just the next iteration of, you

2:03

know,

2:04

uh, from automating strategies now to

2:06

trying to automate as much as I can of

2:09

doing backtesting.

2:12

So, I'm it's it's

2:14

you know, when I when I first started

2:16

using Claude code about 8 months ago, it

2:19

was

2:20

a trader friend of mine said, "Dave, you

2:21

should really start using this." I was

2:23

like, "Well, I mean, I'm using ChatGPT.

2:25

I mean, what's what's really the big

2:26

difference?"

2:28

But man, once I started using it, I was

2:29

like, "Oh my gosh, this is really

2:30

great."

2:32

So, it really opened up a whole new

2:33

world,

2:34

but

2:36

you know, one thing that I think about,

2:38

you know, from my CTO days,

2:41

just because Claude can do all these

2:42

things for you, it doesn't mean the

2:44

rules of software development have

2:46

changed. Like, there's still basic rules

2:49

that

2:51

people have to follow and and and it's

2:53

good practices to follow.

2:56

So, there's lots of things that

2:59

there there's

3:00

there's lots of ways that you can get

3:03

into a trap if you're not careful. And

3:05

and I've just known this from being a

3:07

software developer for so many years.

3:10

Uh, so yeah, it's an exciting time to be

3:13

a trader, it's exciting time to be a

3:15

developer.

3:16

Um,

3:18

but yeah, there's there's certain

3:19

guardrails you need to impose on

3:21

yourself with this this amazing tool.

3:23

>> I 100% agree and I feel like not a lot

3:26

of people are talking about those traps

3:28

in general. But I'm excited to get into

3:30

these bullet points as well.

3:31

>> Uh, first bullet point here, the first

3:33

step you could do to automate the

3:36

backtesting and systematic trading that

3:38

you're doing is

3:39

have give Claude the path to be able to

3:43

run a backtest on your behalf.

3:45

So, may maybe you've already got a

3:47

backtest

3:48

and

3:50

give it the tools to actually run it

3:52

without intervention. You can say,

3:53

"Okay, just go run the back test." And

3:55

that means like the tool I use is

3:58

AmiBroker.

3:59

So, that means run the back test,

4:03

save the CSV results to the standard

4:05

place,

4:07

and

4:09

not all back testing tools allow you to

4:12

do this. So,

4:14

you can't even use Claude code to run

4:17

back tests in most back testing software

4:20

out there. So, the only ones I know, in

4:22

fact, I think you can't do it in

4:23

TradeIdeas.

4:25

The only ones that can do it, I believe,

4:27

are AmiBroker and RealTest.

4:30

Uh and Kite, the tool that you guys have

4:33

access to, but retail traders don't have

4:35

access to that tool.

4:36

>> That makes a lot of sense. I wasn't sure

4:38

when you were coming on uh with back

4:40

testing with Claude if it was going to

4:42

be that you gave Claude like a ton, like

4:45

an entire CSV of all minute bar data for

4:48

a ton of stocks, and then it was able to

4:50

like do some sort of its own makeshift

4:53

back testing, or if it was this link.

4:55

So, you're linking it with AmiBroker.

4:57

Would you like to gain the biggest edge

5:00

a retail trader can get? All of our

5:02

daily and weekly in-house trader

5:04

meetings are now available to you. Just

5:07

head over to smbtrainingfloor.com

5:10

to find out more.

5:11

>> A lot of traders come to me and have

5:14

tried the route of having Claude do

5:16

everything.

5:18

And it's tempting to do that. I

5:20

I totally get the draw of doing that,

5:23

but it's sort of like

5:26

it's sort of like wanting to use a

5:28

spreadsheet and then like building your

5:31

own Excel and not just using Excel. I

5:33

mean, why would you want to do that?

5:35

Well, Claude could build you an Excel,

5:37

right?

5:38

>> Yeah.

5:38

>> But that's No, it makes no sense to do

5:39

that.

5:40

And that's the trap I see a lot of

5:42

traders fall into. They think they can

5:44

do it all with Claude.

5:47

And there's just AmiBroker's been around

5:49

for like 30 years now, if you can

5:51

believe me, a long time. And it's the

5:54

most efficient way to do this

5:57

for the retail trader.

5:59

And there you know, there's just been so

6:01

many lessons learned. The same developer

6:03

the whole time, same interface the whole

6:06

time.

6:07

And you know, you're going to some

6:09

people look at the interface was like,

6:10

man, this looks like it's from

6:12

30 years ago. So, well, yeah, it is. So,

6:15

that's a good thing.

6:18

>> And for you, how easy was linking it?

6:21

Um, is that something that you even ask

6:23

Claude on how to do it? Or like, how

6:26

would you go about that?

6:27

>> So, there is So, AmiBroker has an

6:31

interface, a standard interface that

6:33

Windows had and has had in there for

6:35

years of

6:37

like automating software.

6:40

So, it's a standard interface for

6:43

basically

6:44

performing the functions in AmiBroker

6:46

outside of AmiBroker via a Python

6:49

script. There's a really good example

6:50

this that I have on my mailing list. We

6:53

can put a link in the show notes to it.

6:55

Um, it's standard Python code for doing

6:57

[clears throat] this exact function.

6:59

So, it's and

7:02

you know, this has been in AmiBroker for

7:04

years, but and I've used it for years

7:07

just, you know, writing my own Python

7:09

scripts to

7:10

you know, run back test for certain

7:12

things.

7:13

But now it's just, okay,

7:15

it's unlocked to non-developers via

7:18

Claude. So, you can have teach Claude

7:20

how to do it. And

7:22

the next few bullet points I'll talk

7:24

about is

7:27

specific things you can teach Claude to

7:29

do to actually help you develop a

7:31

strategy. So, that's what that's what I

7:33

want to talk about next.

7:36

>> That's great. So, step one, link it.

7:39

And start back testing.

7:41

>> Yeah, so most traders probably already

7:42

have a back test that they're using or

7:45

they're close to having one.

7:47

Um, and that's sort of the first or they

7:50

can come up with one, you know, a

7:52

sort of a stock one pretty quickly.

7:54

Uh, just to get that function working.

7:57

So, what one example, I mean, one of the

7:59

things this unlocks is

8:02

you know,

8:04

a lot of these back tests can take, you

8:06

know, an hour to run. So, you're

8:09

you're you're

8:10

you know, you've written some code,

8:12

you're you think it's right, you you run

8:14

the back test, it takes an hour, then

8:16

you get your results. Well,

8:18

yeah, that's not immediate, so

8:20

you know, you're out of the context, you

8:22

go off doing something else waiting for

8:24

it to finish.

8:26

So, it's sort of an inefficient thing.

8:27

So, a lot of traders that I work with I

8:30

show them this workflow and then they

8:32

can run four or five back tests

8:34

overnight and then then it's there

8:36

waiting for them when they wake up.

8:38

>> Is that because they're queued one after

8:40

another?

8:40

>> Do you want to sit in on all of our

8:42

daily and weekly in-house trader

8:44

meetings? There's no bigger edge retail

8:47

traders can get. Visit

8:48

smbtradingfloor.com

8:50

to learn more.

8:51

>> Yeah, so there's a way to parameterize

8:53

certain things in a back test

8:55

let's say you want to run different

8:58

versions of a back test and you've

8:59

created parameters

9:01

in there that, you know, do slightly

9:03

different versions of it and you're

9:04

trying to figure out which one's best.

9:07

You can have it run each iteration of

9:09

those parameters and then you have, you

9:12

know, however many back tests waiting

9:14

for you when you wake up based on that.

9:16

So, it's a much more efficient workflow

9:19

than, you know, clicking the button,

9:21

trying to remember to come back and see

9:23

when it's complete, then manually saving

9:25

the results to a CSV file and,

9:28

you know, maybe doing that in a

9:29

non-standard way. If you standardize a

9:31

lot of this, it becomes a lot easier and

9:34

your whole

9:35

workflow for coming up with strategies

9:37

gets a lot easier.

9:38

>> There would be certain models when we

9:40

were looking to backtest, we just knew

9:42

the backtest would take so long where we

9:44

would try to get everything done by

9:46

Friday so you can put it in over the

9:47

weekend.

9:49

And the overnight is I mean that's a

9:52

small Chico but it's like it's an easy

9:55

fix but such a massive difference like

9:57

>> Yeah.

9:58

>> It's like four to five x probably the

9:59

amount you're able to backtest.

10:01

>> Yeah and I mean it takes a little bit of

10:03

planning but once you get this workflow

10:05

going to see what's possible then you

10:08

start thinking okay if I can do it this

10:09

way then I can set up parameters for

10:11

this and

10:13

you know have this running while I sleep

10:15

and I can wake up and you know optimize

10:17

the strategy in the morning.

10:20

>> What a time saver. Yeah what what a what

10:22

an amazing time saver. All right so so

10:24

how are you leveraging this? Is are we

10:26

on the step two now?

10:27

>> So

10:28

>> [clears throat]

10:28

>> that's sort of the basic

10:30

step.

10:32

Um

10:33

step two I want to talk about

10:35

how to actually create a strategy have

10:38

Claude and I'm using Claude you know

10:41

you can use chat GPT in the same way or

10:43

Codex.

10:44

Um

10:45

have Claude create a strategy for you.

10:50

So

10:51

you give it the parameters, you give it

10:53

the outline okay this is what the

10:55

strategy is supposed to do

10:56

and then it come it writes the code for

10:58

you for the actual backtest.

11:02

And the

11:03

the most important thing to do here cuz

11:05

I've seen a lot of traders try this

11:07

especially with Amibroker

11:09

there's

11:10

there's lots of different ways to write

11:13

a strategy

11:14

and

11:16

if you don't

11:18

streamline it or

11:20

give Claude a reference

11:22

of a good you know this is the way I I'm

11:25

talking about when I say come up with a

11:27

strategy write it in this way

11:30

it

11:31

it kind of gets lost and it'll come back

11:33

with many different ways. Like it could

11:34

be any number of different ways. And

11:36

it's more expensive those requests, you

11:38

know, it's going to cost more tokens

11:41

for you to do that. So, if you give it a

11:43

reference, if you say, "Okay, here's a

11:45

strategy that I've created.

11:48

Use this as a reference and but do this

11:50

instead."

11:52

That's going to be a huge time saver and

11:54

it's going to

11:56

you know, this comes from

11:58

my day, you know,

12:00

many years being a CTO.

12:03

A a big part of when I was at TradeOut

12:05

is

12:06

when I became CTO, a big thing I could

12:09

see was like everybody was writing code

12:11

in silos.

12:13

There was no standardization.

12:15

Uh you would look at somebody else's

12:17

code and you were like, "Oh my gosh,

12:18

this is

12:20

this looks so foreign to what I do. This

12:22

is not conforming to a standard."

12:25

So, a big part of it was coming up with

12:28

a style guide and really enforcing it,

12:31

saying that any new code that we submit

12:33

is going to be in this standard and it's

12:35

going to be in the standard of the

12:37

language that we're writing in.

12:39

So, and that just becomes it it smooths

12:43

things out. It's a little it takes a

12:44

little bit of effort, you know, some

12:46

people think it's like busy work, but it

12:48

was a huge thing because it just every

12:51

everything gets more cohesive and and

12:53

gets easier.

12:55

>> Is it enough to just give it the example

12:58

uh script, the Python script, or are you

13:01

really like telling the methodology of

13:03

how you're writing it before?

13:06

>> All right. So,

13:09

in Amber Broker, there's like I said,

13:11

lots of different ways to come up with a

13:12

strategy.

13:14

But I have used so many different ways

13:18

and I've

13:19

finalized on what I think is the right

13:21

way to do it because there's one there's

13:24

only one way to do it where you can add

13:25

custom columns to your backtest, which

13:28

is such an important part of I mean you

13:30

know

13:31

preaching to the choir here, but

13:33

it's such an important part of coming up

13:35

with a strategy

13:37

that it's

13:39

it's almost impossible to come up with a

13:41

strategy without doing that.

13:43

>> 100%

13:44

>> And

13:45

and there's you know most traders don't

13:47

realize so

13:49

I mean

13:51

I've

13:52

created an AFL generator that does it in

13:55

the right way.

13:57

And

13:58

and it uses Claude on the back end. This

14:00

comes with Maybank

14:01

and I've heard from traders that have

14:03

used it like they were trying to get

14:05

Claude to write AFL before.

14:08

Once they started using this as a

14:09

reference

14:11

Claude became much much better at

14:13

writing AFL because it's using it you

14:16

know it's doing it the right way. It

14:18

knows what you're it knows the context

14:20

with which you're asking it to do. So

14:23

it's

14:24

giving it a reference is is just super

14:26

important.

14:27

>> I've noticed that even with writing

14:29

alerts

14:30

like I've used the first like

14:32

project that I took on with Claude was

14:34

just trying to script up a bunch of

14:36

these alerts that I had on a to-do list

14:38

that I never got to and I gave it one of

14:41

my alerts

14:42

the scripts for it and that helped a

14:44

ton.

14:45

But I haven't done on the model side.

14:47

>> It's going to be I mean that is a very

14:50

important thing to have it do. Like you

14:52

want to I mean every have you ever

14:54

looked at somebody else's code that you

14:56

didn't write?

14:58

>> It's

14:59

it's kind of jarring when it's not you

15:02

know it's written a little bit

15:03

differently they do things differently.

15:05

But imagine you know if both people are

15:07

writing with the same style and the same

15:11

Like you may you may think well this is

15:12

Claude writing the code. Does it really

15:14

matter? Well yeah I mean

15:16

it does matter and and it does make it

15:18

more efficient. So

15:20

if you give it

15:22

uh

15:23

you know

15:24

the the strategies that you run, here's

15:26

how I write them.

15:28

It's going to be a lot more efficient

15:30

because it knows what to do. It doesn't

15:31

doesn't have to guess.

15:33

>> Jared, you'll remember too when we were

15:35

working with Nick, this is when we were

15:37

like just starting out coding.

15:39

Um Nick would look at our code and be

15:40

like, "What is this?"

15:42

>> [laughter]

15:42

>> Like

15:43

>> And you're putting in nice like

15:44

>> read this at all.

15:45

>> Yeah, and you're you're you're making

15:46

this PG for the for the

15:49

>> Oh, he would yeah, he would

15:51

>> [laughter]

15:51

>> kind of get a little mad at us.

15:54

>> I mean, that's how we learned how to

15:55

code though. He'd be like, "Oh, this is

15:56

garbage." And he'd be like

15:58

>> To your point him

16:00

uh that's really how we learned how to

16:01

code because Nick was so hard on us when

16:04

we would just write spaghetti code.

16:06

And we'd ask him, "Hey,

16:09

uh

16:09

this thing is not like working, you

16:11

know, can you just cuz we knew he knew

16:13

everything. Can you just look at this

16:15

and you know, kind of tell us what to

16:16

do?" And he'd be like

16:18

"Just put in print statements." And he'd

16:20

just yell at us to like he'd be like,

16:22

"This is what I would be doing, so you

16:23

guys should just do it." And

16:25

it was great. That's how we learned how

16:27

to do it, you know, and it's just it's

16:29

funny and now I guess you don't need to

16:30

know how to do any of this, but the

16:31

thing Dave that

16:33

that I'm kind of getting out of what

16:34

you're saying is that it still does pay

16:37

off to kind of have some level of

16:39

understanding of like how this sort of

16:42

like back end like programming stuff

16:44

works when you're doing this.

16:46

>> Oh, yeah, then no question about it. I

16:47

mean, there So, there's this concept in

16:49

software development called technical

16:51

debt.

16:52

And

16:54

the way you should think about it is,

16:55

you know,

16:57

junior developers, new developers might

17:00

write code. And you might have a senior

17:02

person like Nick look at it and say

17:05

"You know, this needs to be better." And

17:07

the developer might say, "Well, it works

17:09

right here. It's doing what it's

17:10

supposed to do."

17:11

But the senior developer might look at

17:13

it and say, "Yeah, okay, it works, but I

17:16

can tell from my experience that

17:20

eventually

17:21

this is going to be a

17:24

a big pain to maintain. It's written in

17:26

a non-standard way. You could write this

17:29

in a lot fewer lines. You could You

17:32

could make that You've done it like in a

17:33

very convoluted way.

17:35

And

17:37

it's it's good to uh

17:40

It's good to sort of respect and

17:43

understand where that senior developer's

17:44

coming from because they've been through

17:46

this and they see what can happen over

17:48

time

17:49

as technical debt develops. So,

17:53

and it's uh

17:55

I mean

17:56

I'm really interested to see how this

17:59

whole Claude thing plays out because

18:00

there's so many people now who think

18:02

they're developers, right? And really a

18:04

lot of what I can see a lot of people

18:06

doing

18:07

is creating technical debt very quickly

18:11

and they have no idea that they're doing

18:12

it.

18:13

So, it's just I'm very curious to see

18:16

how it plays out.

18:18

Yeah, Claude can help with that if you

18:19

know what you're doing, but it's still

18:22

like people ask like people take on

18:25

bigger projects than

18:27

they should. It's It's just I'm very

18:30

curious as

18:31

as a long-time software developer to see

18:33

how this plays out.

18:33

>> I'm probably guilty of that as well. Not

18:36

to deviate too much, but I wonder there

18:38

has to be a way of trying [snorts] to

18:40

get Claude to continually review, like

18:44

almost debug for technical debt.

18:47

>> Yeah, there is no question that you can

18:49

set that up.

18:50

Um

18:51

so

18:52

you know, I coach a lot of traders who

18:54

want to get into systematic trading.

18:56

The very first thing that we focus on or

18:59

one of the first things is how to use

19:01

GitHub well.

19:03

Um

19:05

I see so many traders I I haven't seen a

19:07

trader yet that uses GitHub the right

19:10

way.

19:11

And it may not be a big deal in the you

19:14

know, when they get started, but once

19:16

you start putting code into production,

19:18

you know, once you have a strategy live,

19:21

and you go to start making changes to

19:23

it, if you don't have good

19:26

version control practices, if you don't

19:29

have good

19:30

uh

19:31

practices for using GitHub in its sort

19:33

of a standard way, you're going to get

19:35

yourself into a problem. I can guarantee

19:38

it. It may not be today, it may not be

19:39

tomorrow, it may not be next week,

19:42

but you're going to get yourself into a

19:43

pickle if you don't have good

19:46

software development practices.

19:48

And

19:49

like I said, I haven't seen a trader yet

19:51

that uses GitHub the right way, and

19:54

there's just a few

19:56

steps to

19:58

a a few principles

20:00

to to really use it the right way and to

20:03

set up your process so that you avoid

20:06

these pitfalls.

20:07

>> What are those principles?

20:10

>> Um

20:12

well,

20:13

using branches well in the way they're

20:15

intended. So, there's what's called the

20:19

main branch.

20:21

Most people are just committing to the

20:23

main branch.

20:25

And the reason that's bad is

20:28

it's not like

20:30

>> [clears throat]

20:32

>> the way you want to do it and when you

20:33

create a change, like you you you get

20:36

your code into main,

20:38

and now let's it's in production. Let's

20:39

say you've got a strategy running and

20:41

it's making trades for you.

20:43

And now you want to make a change to it.

20:46

Well,

20:47

you don't want to develop right in that

20:49

main branch. You want to create another

20:51

branch, which is basically a copy of the

20:53

main branch. It doesn't affect the main

20:55

branch.

20:56

And you want to make your change, do all

20:59

your testing in there, do all your

21:00

commits into that branch. It doesn't

21:02

affect the main branch in your

21:04

production code.

21:06

You can do all your testing there, and

21:08

then when you're ready to get it into

21:09

the main branch, you do a pull request.

21:12

And the pull request is basically, all

21:14

right, I'm I've done all my testing. I'm

21:18

comfortable with it getting into

21:19

production.

21:21

And

21:22

that pull request is an important thing,

21:25

and you can do code reviews there. You

21:27

can have You can have Claude do code

21:29

reviews, which is

21:30

a a really nice thing for it to be able

21:32

to do. You can have other team members

21:35

look at the code to make, you know, to

21:36

double-check, and you should be doing

21:38

that.

21:39

And then, once it gets into the main

21:41

branch, okay, it's live. It's It can go

21:43

to production.

21:45

That step is such an important thing,

21:47

but it because it encourages

21:50

the right use of of GitHub in a way that

21:53

uh

21:54

uh

21:56

you know, it it is going to get keep you

21:58

out of trouble. The other important

22:00

thing is

22:01

people take, you know,

22:04

uh

22:05

it it's good to do smaller bite-size

22:09

projects.

22:11

Especially with Claude now and and new

22:13

developers, I can see them like taking

22:15

on like doing adding more and more stuff

22:18

when they really should think about,

22:20

okay, I want to do this first, and it

22:21

should be a bite-size thing.

22:24

Create a branch for that, get it live,

22:26

and then go and maybe create version two

22:28

of that.

22:30

Having bite-size

22:32

pieces of work

22:34

is going to be super important, and and

22:36

it it's a lot easier because the problem

22:37

is people get

22:39

uh you know, create

22:41

uh you know, try to do a project that's

22:43

really big and keep adding stuff,

22:46

and they're committing it to the main

22:47

branch. They've got changes in the main

22:49

branch that are separate from the new

22:51

project. It becomes a bear to to merge.

22:54

So, if if you keep these

22:57

uh development hygiene principles in

23:00

place, it makes your life so much

23:02

easier.

23:03

>> It makes a ton of sense. And if you're

23:04

making too many changes and something

23:06

goes wrong, you can't even pinpoint what

23:08

the change that messed everything up

23:10

was.

23:10

>> Absolutely.

23:12

>> Yeah, that's that's great.

23:13

>> where, you know, imagine you're

23:15

you know, you're trying to get this new

23:17

project in and it's affecting some

23:18

production code. You've broken some

23:20

production code by what you're doing.

23:22

And you know, Monday's rolling around

23:24

and you and the strategy needs to run.

23:26

I mean, that's that's the kind of

23:29

scenario that is a nightmare to have to

23:31

deal with.

23:32

>> All right. So, you're to to bring it

23:34

back to the strategy. So, you're you're

23:36

giving it a an example

23:39

of a script that is in your style that's

23:42

that that it can use as a model

23:45

to create this new script. So, is that

23:47

Does that mean that you're giving it the

23:49

actual code for an existing script that

23:51

you have, like say in production? And

23:54

then you're on the on the other hand,

23:56

you're giving it an idea, like a new

23:58

idea, saying like, "Here's the criteria,

24:00

here are the variables. I want you to

24:02

implement this strategy idea with in the

24:06

in the form of of this model script?"

24:10

>> Yes, exactly. So, you know, it's

24:14

it could be a completely different

24:16

concept, completely different strategy.

24:18

>> Right.

24:19

>> But the the basic structure, the basic

24:22

uh

24:23

uh

24:25

conventions,

24:27

the way you make trades, the way you

24:30

uh the way you capture columns,

24:34

um

24:35

everything about the

24:36

sort of the style of the this the

24:39

strategy is in there and and it just

24:42

gives it a much better

24:44

way to get started and and and to do the

24:46

work.

24:47

>> Here's a mind-bending stat for you. SMB

24:49

traders have 20x to 40x higher odds of

24:53

success than independent traders.

24:56

Find out why and how to greatly increase

24:59

your odds by visiting

25:00

smbtradingfloor.com.

25:02

>> I mean, you mentioned like the way the

25:04

way it captures trades, the way it makes

25:06

trades, the way it executes. Like I'm

25:08

thinking about our platform and just,

25:09

you know, the data, not only the

25:11

collection of the data, but the

25:13

the algos, the actual algos that are

25:15

taking the trades. Like there are

25:16

idiosyncratic things that you end up

25:18

doing that are either maybe specific to

25:21

your platform's API or maybe specific to

25:23

your

25:24

best practices, they might be risk

25:26

checks, like things that you might not

25:28

even think about telling Cloud about the

25:31

strategy that it would be good to teach

25:34

it. And, you know, for me, like now

25:36

thinking about this, it's like there's

25:37

no way I don't think I don't think I

25:39

could just give it

25:40

like a strategy idea and then have it

25:43

kind of do what we do.

25:44

>> Yeah, I mean, just like how you do

25:45

position sizing. What's the variable

25:48

name you use for position sizing?

25:50

If you make all that consistent, your

25:52

life you know, your life becomes easier

25:54

later on, like if you need to make a

25:55

change across all the strategies. You

25:57

can search for one variable name because

26:00

you know you're been using that

26:02

consistent variable name across all the

26:03

all the strategies.

26:05

>> So, where do you go from there? Because

26:06

now you've got

26:08

you've got an ability to basically like

26:10

automate the back test that you're going

26:12

to run.

26:13

So, you can do different iterations. And

26:15

then now you have the ability to

26:17

automate the the writing of these script

26:20

ideas. So, you can easily create

26:22

different iterations.

26:24

Um are you doing some

26:27

like master automation that sort of then

26:30

like iterates through things and back

26:31

tests and you can just go sailing for

26:33

the weekend?

26:34

>> Well, you you certainly can. I mean,

26:36

once you get in this workflow, you can

26:38

and I do have back tests that run

26:42

every day and and update the back test

26:45

automatically.

26:46

So,

26:47

but the but there's still

26:49

a couple more important things about

26:52

workflows I've set up

26:54

to help it

26:56

do kind of the grunt work of

26:59

like making sure the strategy is written

27:02

correctly and doing what it's supposed

27:03

to do.

27:05

So,

27:06

I'm going to go on to step three here.

27:08

>> Yeah.

27:08

>> Which is

27:12

give it away, give Claude away. So, I've

27:14

got a skill in there that basically

27:18

allows it to run a smoke test. And what

27:20

I mean by this is

27:23

when you run when you create a strategy

27:24

and then you run it across all market,

27:26

like I said, it's going to take 40

27:28

minutes to an hour maybe to run.

27:30

Well,

27:32

you don't need to run that whole back

27:34

test to have it

27:37

to give it some feedback to see if it's

27:40

working or not.

27:41

So,

27:42

I have the smoke test where

27:45

I say,

27:46

"Okay, only run a certain day or only

27:50

run on a certain symbol." So, I've I've

27:52

set up a skill so it knows how to do

27:54

that.

27:56

And so, it can run and that that takes

27:58

like

28:00

less than a minute, like seconds to run

28:02

that.

28:03

So, it's it can quickly run a back test

28:06

on a like on a specific symbol or

28:08

specific day

28:10

and quickly get back results and then

28:12

verify and see, "Okay, oh well, you

28:14

know, I often times it can do all this

28:15

on its own." I would you know, I got no

28:18

results there. Let me see what's going

28:20

on. Um

28:22

I I got a whole bunch of results.

28:24

Obviously, something's wrong. So, you

28:26

you're

28:27

And a lot of this is tedious kind of

28:29

grunt work that you need to do you would

28:31

be doing on your own. But if you give

28:34

Claude tools to be able to do some of

28:37

this on its own, this is the kind of

28:39

grunt work that it's really good at and

28:41

can really

28:43

save a lot of effort and

28:47

uh pain in creating a strategy.

28:49

>> So, the purpose of this is that you're

28:52

trying to just see if it's doing what

28:53

you think it's doing before you like run

28:55

it

28:56

full back test.

28:58

>> Right.

28:58

>> Okay. And you're able to Are you able to

29:02

kind of cuz you said you're creating

29:03

skills, like cloud skills.

29:06

What are those? Are you able to kind of

29:08

automate the whole chain where it's

29:10

like, "Okay, do the smoke test and then

29:12

like if it's kind of doing what it's

29:13

supposed to be doing, then run the back

29:14

test."

29:15

So, you don't really have to be there in

29:17

the middle.

29:18

>> Yeah, so the

29:21

I want to bring it back to software

29:23

development one more time to It's a bit

29:25

of an esoteric topic, but I think it's

29:27

useful.

29:29

So, there's a concept in software

29:30

development called unit testing. And

29:34

what that is is

29:37

when you write a feature,

29:40

you can create what's called a unit

29:42

test. And that's basically saying,

29:44

"Okay, this function needs to be you

29:48

know, when you give it this

29:49

these parameters, it should come out

29:51

with this result."

29:53

And each time you do a build in

29:55

software, it'll run it can run all the

29:57

unit tests and make sure they pass. If

29:59

they don't pass, something's wrong.

30:02

So, where that comes in handy is

30:05

>> [clears throat]

30:06

>> if you got all your unit tests, you've

30:08

been you've been writing this

30:10

building the software, and you want to

30:12

add a new feature to it.

30:15

You add the new feature

30:17

and you run the test to make sure this

30:20

feature didn't break anything. And you

30:22

can verify that by seeing that did the

30:25

unit test pass?

30:27

Often times you will break a former unit

30:30

test that you had no idea you were

30:32

affecting.

30:33

And then that's an indication that,

30:35

"Okay, that did something wrong."

30:37

Where

30:38

if you didn't have that, you would that

30:40

code would get into production and you

30:42

would a user would call you and say,

30:44

"Hey, something's wrong."

30:45

So,

30:47

giving Claude a way to do that and to

30:49

verify itself is extremely important.

30:52

And that's actually step four.

30:55

Give it away, like similar to a unit

30:58

test,

30:59

to verify its correctness.

31:02

And the way I do that with strategies is

31:06

All right, let's say let's say I'm

31:08

creating an opening range breakout

31:09

strategy.

31:11

I've I've given it the reference.

31:14

One of the things I do is in the

31:16

description of what I want it to do is

31:19

I tell it, "Okay, I know

31:22

that if you've written the strategy

31:23

correctly, it should be matching, say,

31:25

Microsoft on this day.

31:27

That trade should appear in the back

31:29

test.

31:31

And

31:32

now, sort of like that unit test, you've

31:35

given Claude a way to actually verify

31:38

that it's correct.

31:40

So, it could go run a back test and

31:43

gosh, Microsoft didn't show up that day.

31:44

I know I've done something wrong.

31:47

Um so, I've got skills for the smoke

31:50

test.

31:51

There's also a way for it to

31:54

pull market data more generally

31:58

for, say, Microsoft on a given day. So,

32:01

it can actually go do some

32:02

troubleshooting and like tell me why

32:05

Microsoft isn't appearing.

32:07

Or, you know, maybe something about the

32:08

prompt is

32:10

you know, I didn't realize or you know,

32:12

I just you know, wasn't precise enough

32:15

or

32:16

you know, something about it can give me

32:17

some feedback about that and say, "Oh,

32:19

well, it's not in there because this."

32:21

Like the candle so-and-so isn't

32:26

is causing it not to be in the back

32:27

test. What do you want to do about it?

32:29

>> That's specifically cool. I love how you

32:31

keep relating it back to software

32:33

development though, because it's just

32:36

the opposite of live coding. It like you

32:38

said the technical debt like just piles

32:40

up. This is the exact opposite. With

32:43

real world like the analogies they make

32:45

perfect sense. It's doing the exact same

32:47

thing and you're treating it just the

32:48

same as if you were a software

32:49

developer.

32:50

>> Yeah, so it's

32:52

and it is

32:53

and another

32:55

fundamental thing that I

32:57

would

32:59

do at Trade Ideas is so I would really

33:01

encourage the development staff

33:04

to

33:05

think about

33:07

work they could do to make somebody else

33:10

on the team better.

33:12

So, a lot of times you have software

33:14

developers, you know, they're they're in

33:15

their silos, they're doing they want to

33:17

do work on their own.

33:19

But I really encourage people what can

33:21

you do to make somebody else on the team

33:23

better? And that might be

33:25

write some code to

33:27

and make it in a library so that other

33:29

people can use it

33:31

to make their lives better. So now I

33:33

think

33:34

the way I'm thinking about that the

33:36

analogy is what can you do to make your

33:38

AI agent's life a little better?

33:41

And

33:42

that's like giving it away to verify

33:44

itself.

33:45

Giving it a um

33:47

a certain function

33:50

that you know it's going to need to be

33:52

able to use over and over and like in a

33:55

very efficient way to do it.

33:57

That's going to be it's going to make

33:59

your whole workflow better. Like like

34:02

often times you'll like I'll have it

34:04

I'll have called say you know, search

34:07

for something on my computer.

34:09

Now if you just if you don't give it any

34:11

parameters, it's going to take forever

34:12

to come back with and find something

34:15

on your computer, right? But if you say

34:18

all right, look for a file it's going to

34:19

start with, you know, log. It's going to

34:22

end with txt. It's going to be somewhere

34:24

here.

34:25

You know, give it a folder. It's going

34:27

to find it really fast.

34:29

So

34:30

it's kind of the same concept for having

34:33

it do its work. When when you notice

34:34

it's

34:36

taking a little bit longer than it

34:37

should to do something

34:39

or it's doing that over and over and

34:41

over like

34:42

step back and figure out, okay, how can

34:44

I make it go faster? And, you know,

34:48

essentially, how can you make your AI

34:50

agent's life a little better?

34:52

>> This makes it so much more efficient.

34:53

It's like this is genius because I mean

34:55

to me this there's two things going on

34:57

here.

34:58

There's probably two things going on

34:59

here cuz I'm an idiot, but like A, it's

35:02

like you're outlining developer best

35:04

practices.

35:06

And then B, you are basically then going

35:08

ahead and implementing that into the

35:11

code so that those things are automated.

35:14

So like it sounds like these are things

35:16

developers, like good developers, have

35:18

just been doing like for years.

35:20

We need to make Claude do them.

35:22

Tim and I, I mean, we're just we're

35:24

homegrown, you know, developers. Like we

35:26

figured this stuff out on our own. So we

35:27

have some of our best practices and it's

35:29

all learned from like making mistakes,

35:31

right? And like we've I can't tell you

35:33

how many times we've been sitting there

35:34

coding

35:36

and it gets to the end of the day and we

35:37

want to finish this model

35:39

and, you know, Tim is starting to press

35:42

his foot on the gas. And it's like make

35:45

this change, make this change, and I'm

35:47

like, Tim, like we might need to like

35:49

back test this or slow down. He's like,

35:51

"No, no, no, we're good." And then

35:53

we back test it and like something's

35:55

broken and now we just made 15 changes

35:57

and we have no idea what like what broke

36:00

it, you know? So then we start to like

36:02

create rules like, okay, you know, let's

36:04

um

36:05

if we make a big change, we need to like

36:08

test it and and that sounds like, you

36:10

know, kind of like your unit test or

36:13

you know, something something along

36:15

those lines. And it's like automate It

36:17

sounds like you're finding ways to

36:19

automate these types of

36:22

practices directly into Claude, which

36:25

is, you know, genius cuz I haven't done

36:27

any of that. Like even as I

36:30

develop my trading assistant and my

36:32

research tool,

36:35

um those are fairly big jobs. Like you

36:37

kind of said it yourself. Like people

36:39

are taking on these big like

36:40

all-encompassing jobs where like I have

36:43

no idea what's going on in the code.

36:45

Like I'll ask Claude to like spit

36:48

back to me what is in the code base and

36:50

like what's changed, but like ultimately

36:52

like I'm not reading it the same way

36:54

that I would read a script.

36:56

You know, with Tim. And so I could

36:58

probably be using some of these best

36:59

practices

37:01

in my own projects. Like even if they

37:03

aren't um actual algo scripts.

37:06

>> You bring up a good point because

37:09

some projects aren't super like

37:12

mission critical, right? Some of them

37:14

aren't actually making trades. They're

37:16

just nice-to-haves. Which those are

37:17

great. I mean, it's great that you've

37:19

got I know I'll I'll listen to those

37:21

episodes. That that is such a cool thing

37:22

that you're able to do.

37:24

A lot of these dashboards are really

37:26

important for trading.

37:28

Um

37:29

but it you know, if it was down

37:32

and you it was broken for some reason,

37:35

is it actually mission critical compared

37:37

to

37:39

something you know, strategies making

37:40

trades? That's a completely different

37:42

thing. And it so it takes a different

37:44

bit of a bit of context and it's more

37:46

important.

37:46

>> It's true, but like I guess what I'm

37:48

thinking of as mission critical is time.

37:51

Cuz like that's what I'm hearing here.

37:52

Like cuz all this stuff takes so much

37:54

time. And like you know, Tim like before

37:56

AI came, Tim and I spent a lot of time

37:59

coding

38:00

and learning and then doing it.

38:04

And it's you know, it takes hours. And

38:06

like it still does. And now we can do

38:07

bigger and better things. So now we're

38:09

spending, you know, hours on maybe more

38:12

grand projects, but we're still

38:14

debugging and we're still doing all this

38:15

stuff. And it sounds to me like what

38:17

you're doing is just saving

38:20

tons of time

38:21

by implementing these things. Like and

38:23

so so to me like that that would be one

38:25

reason to

38:27

to maybe like take take these best

38:30

practices into like just the general use

38:32

of like any large project.

38:34

>> Have you heard this study of tens of

38:36

millions of traders which shows that

38:38

only 1% of retail traders actually make

38:41

it?

38:42

Don't be a statistic. Visit

38:44

smbtradingfloor.com

38:47

to greatly increase your odds.

38:49

>> Yeah, I think

38:50

I I think some of the main takeaways

38:53

like if you if you only take away one

38:55

thing from this

38:57

uh it's like

38:59

give Claude as much context as you can

39:04

to actually do something.

39:06

So there's this

39:08

I don't know if you've heard the term

39:10

one shot. I've started hearing this this

39:12

term one shot that's coming out since uh

39:15

uh you know

39:16

since Claude has come out and it

39:18

basically means I was able to one shot

39:20

this thing which means I was able to

39:22

come up with one prompt and Claude did

39:25

the whole thing with that one shot,

39:27

right? And so that that's kind of what

39:30

you're trying to set up. And I realized

39:32

this when I created the AFL generator

39:35

it uses Claude as the back end. So I and

39:37

I did not when I created that

39:40

I didn't want to

39:42

have a chat interface. I didn't want it

39:45

to you know have a back and forth. So I

39:47

was like okay, how can I set up

39:49

the form and give it the prompt in such

39:54

a way to actually give it an answer with

39:56

just one click. You know what what do I

39:58

need to have? What what are the inputs

40:00

need to be for me to be able to be able

40:01

to do that?

40:03

And I learned a lot doing that because

40:06

I realized the more context you give it

40:09

the cheaper the requests were. So I have

40:11

to pay you know that you're paying for

40:12

these requests that you send to Claude.

40:15

And

40:16

the the more

40:18

context you give it, the more specific

40:21

you are, the better off the the cheaper

40:24

the request and the better the the

40:26

result is going to be.

40:28

And

40:29

I was I have

40:32

I have a really good example from

40:35

uh the Bionic webinar I did on I think

40:38

it was in March where I

40:40

went over this.

40:41

>> Mhm.

40:42

>> An example was like the more specific

40:44

the better. I'm looking at this slide

40:45

right now. Like when you want to create

40:47

a strategy,

40:48

this is a bad way to do it. I'm going to

40:50

give you the prompt. Create a strategy

40:52

that trades opening range breakouts.

40:54

Like that's not very specific, right? A

40:57

way better one is create a strategy that

41:00

goes long opening range breakouts on the

41:03

10-minute time frame starting at 9:40

41:06

ending at 10:30 using a stop at the low

41:09

of the day

41:11

and hold until 3:50 if the stop isn't

41:13

hit.

41:15

It's a lot more context that you sort of

41:18

gloss over with that first request, but

41:20

the more specific you get it you can

41:22

just tell like imagine if

41:24

if I told you to tell me to come up with

41:26

that strategy, like you're going to have

41:27

a lot more stuff to go on and there's

41:30

going to be a lot less back and forth

41:33

with the more specific you're able to

41:35

make the request.

41:37

>> Dave, if you just emailed me create an

41:39

opening range break strategy, I would

41:40

say is this actually Dave?

41:42

>> [laughter]

41:45

>> Also, one shot, that's going to be my

41:46

new favorite term.

41:48

>> [laughter]

41:49

>> That's great. And I think another whole

41:52

episode cuz I feel like I could just

41:54

keep asking questions about the skills,

41:56

but that might even be a whole another

41:57

episode on all of the skills that you

42:01

could build cuz the smoke test is one of

42:03

them, but I like I'm thinking about like

42:06

potential like

42:07

I don't know, just the stuff that you

42:09

care about live even too. Like you have

42:13

a skill that somehow takes your live

42:15

trades and does slippage. And it's like

42:18

a slippage skill. Or like, we talked in

42:21

the past about like what happens if your

42:23

model doesn't take a trade and like has

42:25

a skill to deal with that. And all of

42:27

that we talked about in the last bionic.

42:30

But, I feel like that's a whole 'nother

42:32

world, too.

42:33

>> Yeah, I mean, similar to what we were

42:35

talking about earlier, you know,

42:37

when you see a trade that you think

42:39

should should be in the strategy and

42:42

your strategy didn't take it, it's often

42:45

a lot of debugging going on there to

42:47

figure out why.

42:49

And if like I've got a skill that, you

42:52

know, it's able to pull the market data.

42:54

So, I can quickly say, "Okay, hey, why

42:56

didn't this show up in the strategy

42:58

today?" And it can quickly tell me

42:59

exactly the bars, you know, exactly the

43:01

logic that would need to be in place for

43:03

that to

43:04

have been caught. So,

43:06

yeah, there's so much you can do here

43:08

to to

43:10

uh

43:12

to really

43:14

make your trading better in a way that

43:17

most, you know, most traders are they

43:18

using Claude now and just, "Hey, give me

43:20

a strategy that works, right?" But,

43:22

that's not how you're going to get the

43:24

most power out of it. You can say,

43:25

"Okay,

43:27

help me make my trading better in this

43:30

way. Here's this little process I do

43:32

that I know

43:33

is a little bit tedious or I know can be

43:35

automated. Let's figure out a way to

43:37

streamline that."

43:39

>> Yeah, I mean, it just

43:40

>> strikes me as like ultimately like the

43:41

more things you're able to test in a

43:44

short amount of time, the better.

43:46

Because we never know what's going to

43:47

work. And if we have our process for

43:49

testing like

43:50

the strategy cruncher, right? Looking at

43:53

the columns. Like the first thing we

43:54

mentioned, I think, when we got on here,

43:56

which is as Dave pointed out, was like

43:58

preaching to the choir. Like it's all

43:59

about

44:00

looking at those features and like

44:02

optimizing those columns and and

44:05

and trying different iterations. And

44:07

obviously the strategy cruncher is a way

44:09

to do that. Like we have a tool for

44:10

that.

44:12

But it all takes time. So it's like if

44:14

you can just do a hundred of those, if

44:16

you can in a short amount of time, I

44:18

think that that's like the key here

44:19

because it's like I the the big

44:22

constraint with strategy testing and

44:25

automated

44:27

trading for me

44:29

so far has been time.

44:33

You know, it hasn't been like we have

44:34

the right process.

44:36

It's just how many strategies can I

44:38

test?

44:40

>> You know, I I I can imagine there's some

44:41

traders listening now that are saying,

44:44

"Man, I wish I had that many ideas. I

44:47

mean, the problem is I don't have the

44:48

ideas to be able to test. I would love

44:50

ideas to test." And that's a common

44:54

pattern that I see.

44:56

New traders don't have the ideas yet.

45:00

But at some point, when they get

45:01

experience, they realize you sort of

45:04

convert to

45:06

the bigger problem, which is you have

45:08

too many ideas.

45:10

So as you progress as a trader, that is

45:13

going to be the ultimate bottleneck.

45:15

You're going to have too many ideas.

45:17

It's really hard for some new traders to

45:19

really understand and imagine that, but

45:21

that's what happens as you

45:23

progress as a trader.

45:25

>> Absolutely. Well, Dave Dave, we'd love

45:28

to have you on again

45:29

to get deeper into like Tim said, like

45:32

these skills and maybe just try to

45:34

unpack

45:36

like some of the specifics because this

45:38

is just

45:40

this conversation could go on for a

45:41

while, and it's kind of outside the

45:43

scope of like the points you wanted to

45:44

make today, but I mean, as far as the

45:46

actual takeaways of this, I think that

45:48

like there's there's probably like

45:50

another layer

45:52

that if traders are really interested,

45:54

cuz I know I am,

45:56

um could probably get a little bit more

45:58

specific to figure out, okay, like what

46:00

are these skills that I can create? Like

46:02

how do I do that?

46:03

>> Yeah, I'm happy to come back on and we

46:05

can talk through that. I mean just the

46:07

process of

46:09

you know, listening to your podcast and

46:10

what you've the good work you've put out

46:12

about how you're you know, your

46:13

dashboards you're creating using Claude

46:16

um

46:17

got me thinking about this

46:20

and yeah, I mean this was useful for me

46:22

and I know I'm going to start thinking

46:23

now about okay, how I'm probably going

46:25

to make some some of these skills

46:27

available on my mailing list. So

46:31

and and then I've got this bigger

46:32

project that's in the back of my mind.

46:35

So so my real goal here

46:38

we're talking about one shotting. So so

46:40

my real goal

46:42

ultimate goal here is to create a tool

46:45

that you can give it a chart

46:48

and then it can come up with

46:51

different starting point strategies

46:53

based on that chart that would capture

46:55

that move.

46:57

>> That's pretty sick.

46:58

>> And I'm close like I'm close to being

47:00

able to do that. I just need to carve

47:01

out some time for myself to put that

47:03

together, but I can see a path for that

47:05

working and that's

47:07

I'm excited about that.

47:10

>> Okay, yeah, I want to talk about that.

47:11

>> Yeah, that gets me that gets me thinking

47:13

a lot, so we'll be we'll have to talk

47:16

again.

47:16

>> Yeah, yeah, and I'd I'd love to get your

47:18

feedback [snorts] on that. Like we

47:19

should talk offline about that project

47:22

and what I'm thinking, so.

47:23

>> Yeah, definitely. Well, thank you again

47:25

for coming on, Dave. As always, this is

47:27

so much fun for us.

47:29

>> Oh, thanks for having me. Yeah, it's my

47:30

honor to be on here. This is a great You

47:32

guys are doing such a good job.

47:33

>> Yeah, and and congrats on getting to 100

47:35

podcasts of of your your own. That's

47:38

great. I heard the I heard the news

47:40

there. That's a big feat.

47:42

>> Yeah, thanks. I can't believe we did

47:43

that.

47:44

>> Yeah, that's very impressive. Congrats.

47:46

We're on your tail, but not we're far

47:48

away. We got a little little ways.

47:51

>> Yeah, well, we're hitting the

47:52

inflection. Um all right, thanks, Dave.

47:54

We'll talk to you soon and and hopefully

47:56

on here

47:58

uh not too far into the distant future

48:00

again so we can we can continue this

48:02

conversation.

48:04

>> All right, great guys. Thanks for having

48:05

me.

48:06

>> All right, thanks guys.

Interactive Summary

The podcast features an interview with veteran systematic day trader Dave Maybe, who discusses how to leverage AI tools like Claude for efficient trading strategy development and backtesting. Dave emphasizes treating AI development with the same rigors as professional software engineering, recommending practices such as standardizing code, using version control (GitHub), and implementing automated 'skills'—like smoke tests and unit tests—to verify strategy correctness. By providing the AI with clear references and specific context, traders can significantly speed up their workflow and avoid the pitfalls of technical debt.

Suggested questions

4 ready-made prompts