Jim Simons Trading Secrets 1.1 MARKOV Process

QuantProgram
5 May 202320:12

Summary

TLDRThe provided video script explores various quants and trading strategies inspired by Jim Simons' secretive quant fund Medallion which have achieved high returns. It delves into concepts like Markov processes, mean reverting strategies, and backtesting approaches used by simons to assess probabilities and performance, coded in Python. The speaker analyzes a specific mean reverting strategy Q5 from his course, evidencing its effectiveness across various recession periods. He conveys how quants leverage data, tools and skills to calculate probabilities favoring their trading strategies.

Takeaways

  • 😀 Jim Simons' Medallion fund has averaged 39% annual returns over 30 years, proving Quant strategies can work very profitably over the long term
  • 😮 Key people like Ax and Lofa worked for Simons, developing advanced mathematical models like Markov chains to predict markets
  • 📈 Recessionary periods see very high volatility which suits mean reverting Quant strategies extremely well, leading to huge returns
  • 📊 The Markov chain method models random sequences of market events where future probabilities depend only on the current state
  • 😃 A simple example is modelling a 'Markov' person who randomly visits home, shop and work with differing probabilities
  • 🤔 These probabilities can be encoded in a 'transition matrix' to represent the likelihoods between market states
  • 📉 Using Python we downloaded S&P500 data, calculated up/down days, and derived the probability matrix for consecutive days
  • ✅ The best probability was a 57% chance of an up day following 5-6 down days - this simple rule gave 46% 10 year returns
  • 🎯 Multiple Markov model conditions can be combined across stocks and strategies to improve performance and reduce drawdowns
  • 🌟 The key is using data, tools and skills to systematically turn market probabilities in your favor - as Quants like Simons do

Q & A

  • What is a Markov process in quantitative trading?

    -A Markov process in quantitative trading is a random sequence of market events or price changes where the probability of future events is based only on the current state of the market, not on past states.

  • How did the mean reverting strategy perform during recessions according to the transcript?

    -The transcript states that the mean reverting strategy performed extremely well during the 2008 recession, the 2001-2002 recession, and the recent 2022 recession, significantly outperforming the broader market.

  • What is an example of a transition matrix in the Markov model?

    -An example transition matrix shows the probabilities of an up day following an up day (0.54), a down day following an up day (0.45), an up day following a down day (0.57), and a down day following a down day (0.42).

  • What Markov model probability was most significant in the transcript?

    -The transcript showed that the probability of an up day following 5-6 consecutive down days was 66%, which was considered a significant probability to trade on.

  • How can the Markov model be enhanced according to the video?

    -The video suggests enhancing the Markov model by adding more conditions, applying it to multiple stocks, using machine learning to calculate probabilities, and utilizing a for loop to test different combinations.

  • What Python libraries are used in the Markov coding example?

    -The Python coding example uses the pandas, NumPy, and yfinance libraries to download the data, calculate the probabilities, and create the transition matrix.

  • Who is Jim Simons and what is significant about him?

    -Jim Simons is considered one of the greatest quant traders of all time, running the very successful Medallion fund for decades using quantitative strategies, which has massively outperformed traditional investors like Warren Buffett.

  • What is the benefit of using Markov models in trading?

    -Using Markov models can help traders objectively calculate probability statistics to determine high-probability trading opportunities with an edge over randomness.

  • What were some key strategies used by Medallion fund quants according to the transcript?

    -The transcript mentions Medallion fund quants using mean reversion strategies based on the idea that prices tend to revert after an initial move up or down, as well as Markov chain models.

  • What Python library allows easy backtesting of trading strategies?

    -The transcript demonstrates using the Pine Script editor to easily backtest and visualize trading strategies in Python before deploying them live.

Outlines

00:00

Introducing Markov Chains and Transition Matrices

This paragraph introduces the concept of Markov chains, explaining that they are random sequences of events where the probability of future events depends only on the current state. It provides a simple example comparing a human going from home to shop to work, versus a 'Markov' whose next move depends only on his current location. The paragraph then explains how transition matrices capture the probabilities of different sequences of events in a Markov chain.

05:01

Illustrating Markov Chains for Trading

This paragraph provides a trading example for Markov chains and transition matrices. It shows hypothetical positive/negative percentage moves for a security, and the probabilities of a positive or negative move the next day. These probabilities are arranged in a transition matrix showing the likelihoods of different sequences of up and down moves.

10:04

Building a Markov Model for S&P500 Trading

This paragraph walks through Python code to build a Markov model for S&P500 trading. It calculates the actual probabilities of sequences of positive and negative return days in S&P500 data from 2010-2022. The code prints out a transition matrix showing the probabilities of different combinations of up and down days.

15:06

Using Markov Models to Create Trading Strategies

This paragraph explains how the Markov probabilities can be used to create effective trading strategies. It shows a simple strategy based on a 66% chance of an up day after 5 down days, backtested in Pine editor. It emphasizes combining multiple conditions and strategies to further improve performance, as likely done in the Medallion fund.

20:08

Conclusion and Invitation for Questions

The final paragraph concludes by summarizing the goal of explaining Markov processes and how they can be used in quantitative trading. It emphasizes the flexibility of Markov models for different environments and objectives. It invites viewers to ask any questions they may have in the comments.

Mindmap

Keywords

💡Markov process

A Markov process is a random sequence of events where the probability of future events depends only on the current state, not on the events that preceded it. The video discusses using Markov processes to model stock price movements for algorithmic trading. For example, there may be a 60% chance of an up day following 2 down days.

💡transition matrix

A transition matrix shows the probabilities of moving from one state to another in a Markov process. The video shows a simple 2x2 transition matrix for daily up/down stock moves. This models the likelihood of an up day following an up day, down day following up day, etc.

💡mean reversion

A mean reversion trading strategy assumes asset prices that rise unusually high or low will revert back towards their mean or average level. The video mentions this is one of the key strategies used by hedge fund Medallion.

💡machine learning

Machine learning can be used to predict the probabilities in a Markov model rather than strict historical data. The video suggests this as a way to improve the simple Markov model that was demonstrated.

💡backtesting

Backtesting involves using historical data to test the viability of a trading strategy. After coding the Markov model in Python, the video shows backtesting a simple trading strategy based on the model in Pine Editor.

💡trend following

A trend following strategy assumes that prices which have been rising will continue to rise (and vice versa). The video contrasts this with mean reversion strategies.

💡quantitative trading

Quantitative trading uses statistical models and data analysis to automate trading decisions, as opposed to relying solely on human discretion. Markov processes fall under the domain of quant trading.

💡volatility

Volatility refers to fluctuations in asset prices. The video claims high volatility environments like recessions can provide good opportunities for mean reversion strategies.

💡portfolio optimization

Portfolio optimization involves selecting the right assets and allocation percentages to maximize returns for a given risk tolerance. The video mentions this technique being covered in their quant trading course.

💡probability

Probability is the likelihood of an event occurring, expressed as a number between 0 and 1. The Markov process models the probability of different market conditions based on the previous state.

Highlights

A Markov process is a random sequence of events where the probabilities of the future is based on the current state

In a Markov process, tomorrow's probabilities depend upon today, not yesterday

Markov processes are used in many fields like weather forecasting, not just quantitative trading

For a human, tomorrow's actions depend on the past, but for a Markov process, only the current state matters

The Markov probabilities are calculated based on the current and future states, not the past

We can calculate Markov probabilities from historical data or using machine learning models

The best probability was 66% chance of an up day after 5-6 consecutive down days - a good trading signal

Can create multiple Markov model conditions and add them up to improve performance and reduce drawdowns

The Q5 mean reversion strategy is inspired by Markov processes and performs very well in recessionary markets

Markov processes help get probabilities in your favor - a key for quality trading strategies

Can tweak Markov models using machine learning to better calculate transition probabilities

Creating a larger transition matrix with more permutations of up/down days can improve Markov models

Can focus Markov models on specific environments like recessions rather than just historical data

Applying Markov model signals to multiple stocks and combining models improves performance greatly

The possibilities are endless when combining Markov processes, data, and quant tools for trading strategies

Transcripts

play00:00

what do you think of quants Jim Simon's

play00:02

Medallion fund has done 39 net of fees

play00:05

for three decades which proves that it

play00:07

works they were very very smart yes they

play00:09

got very rich very very smart very smart

play00:11

and very rich yeah and and very high

play00:13

grade by the way yeah Jim Simons Jim

play00:16

cement is considered to be one of the

play00:18

greatest traders of all time who has

play00:20

Beats and the likes of Warren Buffett or

play00:22

Charlie Munger and his strategy as being

play00:24

purely a quan based strategy

play00:27

um what he does in his fund is extremely

play00:30

secretive but there are certain ideas

play00:33

and there are certain concept that we

play00:35

could get from what he does through this

play00:37

book that I've been reading and most of

play00:39

my uh strategies that I've come across

play00:42

which I do in my personal life has also

play00:45

been inspired from this book so what

play00:47

we're going to do today is we're going

play00:48

to take some of the information that we

play00:50

can find in this book and start coding

play00:52

and trying to see the results and try to

play00:55

figure out what Jim cement has been

play00:57

doing in this fund so one of the pages

play00:59

is in the book here it's about ax ax

play01:03

used to work for Jim Simmons he was part

play01:05

of the fund and he's also some kind of a

play01:08

mathematical genius I think he's got

play01:10

like amazing Papers written by him and

play01:13

if you can see in this paragraph he

play01:15

focuses on a thing called Markov chain

play01:17

so in a Markov chain each step along the

play01:19

way is impossible to predict with

play01:20

certainty but future steps can be

play01:22

predicted with some degree of accuracy

play01:24

if one relies on a capable model and

play01:28

they go on to create a stochastic

play01:29

equation based on this Markov chain

play01:32

another important thing which is just a

play01:34

few pages prior to this was this one

play01:37

loafer again another mathematical genius

play01:40

working for Siemens and they did more of

play01:43

a mean inverting strategy so here the

play01:45

strategies were often based on the idea

play01:47

that prices tend to revert after an

play01:49

initial move higher or lower and they

play01:51

would buy if you just gone right if they

play01:53

opened at unusually low prices so that

play01:55

is a typical example of a mean reverting

play01:57

strategies so at the end of the book one

play02:00

of the things that I noticed was his uh

play02:03

trading result and if you can see in

play02:05

2008 2007 which was basically the

play02:08

recessionary time frame uh he went on to

play02:11

make 152 return 136 return that's

play02:14

substantially higher than any of those

play02:17

years and you've got to understand that

play02:19

during recessionary periods the

play02:21

volatility is extremely high and being

play02:23

diverting strategies perform extremely

play02:25

well so even the strategies that we do

play02:27

in our course especially Q3 and Q5

play02:30

worked tremendously well during the

play02:32

2008-2007 recession and also the past

play02:35

two years so this is one of the

play02:38

strategies that we teach in the course

play02:40

Q5 and it's performed very well the past

play02:44

two years and also in the 2008 recession

play02:45

this is a mean inverting strategy so if

play02:47

I can zoom into some of the strategies I

play02:49

can hear short hair close position there

play02:52

long here closer position the next day

play02:55

uh long hair closer position there so

play02:57

you're we're always going to see lots of

play02:59

good trades session environment in the

play03:01

past two years has been really good for

play03:02

a main reverting strategy so this is the

play03:04

trading result of that mean inverting

play03:06

strategy on the spy and if I can look

play03:08

into that Buy and Hold equity line this

play03:10

period you see here that was the 2008

play03:13

recession you can literally see the blue

play03:16

line which is the S P 500 Buy and Hold

play03:18

has crashed almost 50 percent but the

play03:21

main reverse strategy performed

play03:22

extremely well now if you can go back to

play03:24

the 2001-2002 period it's literally an X

play03:27

the Blue Line went down considerably

play03:29

while our strategy performed extremely

play03:31

well same thing can be seen the past two

play03:34

years because 2001 to 2000 2021 2022 and

play03:38

including now the market still hasn't

play03:40

recovered you can see from the peak it's

play03:41

been going down and still isn't like a

play03:43

consolidation doesn't recover at the

play03:45

highs but the strategy is performed

play03:47

extremely well and the reason why is

play03:49

because of the recessionary environment

play03:50

recession your volatility based High

play03:52

wealthily based environment gives great

play03:54

results for mean inverting strategies so

play03:57

what we're going to do so if you guys

play03:58

want to check out this course us feel

play04:00

free to visit our website at one program

play04:03

and this strategy comes in the corn

play04:06

program Prometheus which includes 10

play04:08

strategies and it also includes many

play04:10

other important strategies along with

play04:13

Trend following and momentum based and

play04:15

also Monte Carlo simulation portfolio

play04:17

optimization forward testing and all the

play04:20

other important Quant trading tools

play04:22

necessary so what we're going to do in

play04:25

this video is good we're going to

play04:26

discuss what the Markov process is

play04:27

because Marco process is what's what we

play04:31

saw from the book and what is a markup

play04:33

process and how we can create trading

play04:35

strategies from the Marco process

play04:38

so to start off with a markup process is

play04:41

basically a random sequence of events

play04:43

where the probabilities of the future is

play04:46

based on the current state

play04:48

okay it's not based on the past so

play04:51

tomorrow's probabilities depends upon

play04:54

today it's not dependent on yesterday so

play04:57

for instance if I have to predict the

play04:59

weather

play05:00

the weather prediction for tomorrow is

play05:03

based on today and not yesterday so

play05:06

Marco process used in many different

play05:08

fields just not in the quantitative

play05:10

trading field it's also used in weather

play05:11

forecasting and many other fields so I

play05:14

hope you guys understood the definition

play05:15

of markup process now I'm going to the

play05:17

example of it so you guys get an idea in

play05:20

simple terms so let's take two scenarios

play05:22

so one is a markup guy and the other is

play05:25

a human being

play05:26

so let's take the case of a human being

play05:28

let's take myself as a condition so I

play05:31

wake up in the morning I wake up at home

play05:34

and then I go to the shop to buy some

play05:36

stuff and I buy the stuff and then I go

play05:38

to work so when I reach the shop I know

play05:42

I came from home so there's no reason

play05:44

for me to go back to home so I can go

play05:47

straight to work so Marco on the other

play05:49

hand he goes from home and goes straight

play05:52

to the shop and now he's in the current

play05:53

state right so in the current state

play05:57

he can go either home or to work because

play05:59

he doesn't know what happened the

play06:01

previous instance as compared to human

play06:03

being

play06:04

so the whole Mark of probabilities is

play06:06

based on this

play06:08

um

play06:09

this current state and future State

play06:11

because the shop is where the corner

play06:13

state is and once Markov is in that

play06:15

currency of the shop he can go either to

play06:17

home or to work but when Markov is at

play06:20

work he has nowhere else to go so he

play06:22

goes straight to shop same thing goes

play06:24

when he's at home he has nowhere else to

play06:25

go and then he goes straight to the shop

play06:27

so if you're calculating the

play06:29

probabilities of the Markov that's when

play06:31

things get slightly not complicated but

play06:34

the numbers start to come into play so

play06:36

when he is at home there's only one

play06:37

place for him to go and that is to the

play06:39

shop so there's a hundred percent

play06:41

probability that he will go to the shop

play06:43

so then we write one now on the other

play06:47

scenario when he's at the shop

play06:49

as I said before he doesn't know where

play06:51

they where he came back from so he can

play06:54

go either to home or to work so now

play06:57

there's a 50 chance for him to go either

play06:59

home or work

play07:01

now once Marco reaches work again he has

play07:04

nowhere else to go so he's got 100

play07:05

probability that he will go to the shop

play07:08

so

play07:10

this is how simple the marker

play07:11

probability is now if you are putting

play07:14

this into trading perspective so let's

play07:16

let's take a trading example into

play07:18

consideration so forget the thing that's

play07:20

going on here let's just focus on this

play07:22

one here so these numbers are

play07:24

hypothetical numbers so I'm going to

play07:25

explain to you what it's all about so

play07:27

you see this positive percentage and

play07:29

negative percentage so whenever you see

play07:31

the news you always see the market when

play07:32

that five percent of the market went

play07:34

down two percent and things like that so

play07:35

that's a percentage move for the

play07:37

specific day so in this percentage

play07:39

positive percentage move the 0.7 depicts

play07:43

the probability of the next day being a

play07:46

positive percentage so if today is a

play07:48

positive percentage close if today is an

play07:50

up day

play07:51

uh then the next days probability is 0.7

play07:55

now the 0.7 is just a hypothetical

play07:57

number so don't don't go deep into it as

play07:59

of now

play08:01

um so this positive percentage for the

play08:03

next day to be positive percentage is

play08:04

0.7 so what will be a negative

play08:06

percentage it's pretty simple it's 1

play08:07

minus 0.7 that is 0.3 so you can see the

play08:10

arrow here that's minus percentage so

play08:13

similarly when it's today is negative

play08:16

percentage what is the probability that

play08:18

the next day will be negative well here

play08:20

I put in 0.2 so what's the probability

play08:23

that it will be a positive it's 1 minus

play08:25

0.2 which is 0.8 now how did I come

play08:28

across all these numbers well you can

play08:31

calculate in many ways you can calculate

play08:32

just based on historical data you can we

play08:35

can calculate the number of updates the

play08:37

number of down days and divided by the

play08:39

uh update and the total number of down

play08:41

days and we'll get the probability of

play08:42

the up days and down days and then there

play08:44

are machine learning models as well so

play08:46

if you can go through that book one of

play08:48

the things that they have done is even

play08:49

off before many years you're talking 30

play08:52

years or so they've been using machine

play08:54

learning models but now these days you

play08:57

can use machine learning models with

play08:58

just a few lines of code so I hope you

play09:00

guys understood the whole idea of this

play09:02

thing of this markup probabilities these

play09:04

numbers are just hypothetical but now

play09:06

you can put this into a matrix right

play09:09

this is called transition Matrix so

play09:11

you've got the positive percentage

play09:13

you've got the negative percentage

play09:14

you've got the positive percentage

play09:15

you've got the negative percentage here

play09:16

as well in the columns so a positive

play09:18

percentage and the next day is a

play09:20

positive percentage is 0.7 as you saw

play09:22

here

play09:23

similarly a positive percentage and the

play09:26

next day is a negative percentage is 0.3

play09:29

again negative percentage day and the

play09:32

next day is a positive percentage day is

play09:34

0.8 as you can see here and a negative

play09:36

percentage

play09:38

followed by the next day a negative

play09:39

percentage is 0.2 so if you can observe

play09:43

something 0.7 plus 0.3 is 1 and 0.8 plus

play09:48

0.2 is again one so this is basically a

play09:51

transition Matrix so here we have just

play09:53

taken two days in a row so we can

play09:55

actually have more rows and more columns

play09:57

where you can have uh plus plus minus

play10:00

minus a plus plus minus minus minus you

play10:03

can have many kinds of permutations and

play10:05

combinations in this but these is

play10:07

basically a mark of trading and this is

play10:09

how we calculate the trading property so

play10:11

now what we're going to do is we're

play10:13

going to go to a real world example on

play10:15

spy and we're going to calculate the

play10:18

probabilities of the Spy getting a

play10:21

positive percentage on the next day

play10:23

following the previous day being the

play10:25

positive percentage and similarly

play10:27

negative and negative and negative and

play10:29

positive so this is the Anaconda

play10:31

notebook where we'll be calculating the

play10:33

Marco process and transition

play10:35

probabilities

play10:37

um and if you don't know anything about

play10:40

python

play10:42

then I would suggest you to go to our

play10:44

video in our Channel algorithmic trading

play10:47

in Python so you get the basics of how

play10:49

to do python so it'll be really

play10:51

beneficial for you in your Quant trading

play10:53

Journey you can also do the trading

play10:54

Viewpoint script if you fancy as well so

play10:56

now going to the Anaconda notebook so

play10:59

first thing we do is basically we

play11:00

download the Y Finance library and the

play11:02

pandas in the numpy which is necessary

play11:04

for us to calculate many things then we

play11:07

download the data so we download the

play11:08

data for spy from 2010 to 2022 you can

play11:11

download more data or you can keep the

play11:14

data smaller so you can access different

play11:16

time periods so for example if you want

play11:17

to just assess a recessionary time

play11:19

period you can just do the 2008 or the

play11:21

2001.com Bob request so you get the

play11:24

recessionary environment data as well so

play11:25

it's up to you really so I've just

play11:27

randomly chosen 2010 to 2022. and then

play11:32

we've actually downloaded the data

play11:35

um and basically you can see the Open

play11:37

high low close and the just close and

play11:38

the volume so we need to get up on the

play11:40

daily return so we're going to take the

play11:41

adjuster close and Dot percentage change

play11:43

function and that will give us the

play11:45

percentage difference between yesterday

play11:47

and today and also the states so

play11:50

basically state is where the daily

play11:52

return is greater or equal to zero we

play11:54

have got up so we've got the num uh

play11:57

numpy pandas numpy SNP so that's why we

play12:00

use NB here so daily routine is greater

play12:03

than is equal to zero then it's an

play12:04

update else it's a down day and then

play12:06

we've stored it in data of state so then

play12:10

here is the data frame of the data and

play12:12

you can see the daily return here and

play12:14

whether it's an up percentage closed or

play12:15

a down percentage close so

play12:17

you can see whenever there's a positive

play12:19

one it's up and whenever there's a

play12:21

negative one it's down negative here

play12:23

again it's down uh negative here it's

play12:26

again down as well so basically uh we're

play12:28

using uh just pure map to find out the

play12:31

probabilities as compared to using

play12:33

machine learning models however uh in

play12:36

the book they've talked about machine

play12:38

learning models and that was years ago

play12:39

so now you can do a machine learning

play12:41

models just with a few lines of code so

play12:43

if you guys are stoked about doing this

play12:45

making this more efficient then go ahead

play12:47

with the machine learning model as well

play12:49

but as of now we're just going to make

play12:50

it simple so you guys can understand the

play12:52

process so we've got the up counts and

play12:54

the down counts so up counts is

play12:56

basically you take the length of the

play12:58

data of the state where it's up so how

play13:02

many days has there been up and then

play13:03

similarly down counts give you the

play13:05

length of how many days it's been down

play13:07

so if you can get that information then

play13:09

we can calculate the probabilities we're

play13:10

not going to use these two lines of

play13:11

codes anyway but it's just created to

play13:13

give you an understanding on how to

play13:15

calculate the probabilities

play13:17

so up to up is like two consecutive

play13:19

positive percentage close uh down to up

play13:22

the negative day followed by a positive

play13:25

day and up to down similarly and down to

play13:27

down two consecutive uh down days

play13:30

so we calculate the length of the how

play13:32

many times the days has been like

play13:34

consecutive updates and then we divided

play13:36

by the update and that will give us the

play13:38

probability of a two consecutive updates

play13:40

similarly uh down to up up to down and

play13:43

down to down and then we'll do a

play13:45

transition Matrix where we've got like a

play13:47

pandas data frame and we're going to put

play13:48

all these results into like a matrix

play13:50

kind of a fancy kind of a way and then

play13:53

we'll print the transition Matrix and

play13:55

we've got the information so you can see

play13:57

up to up is 54 percent

play14:00

up to down is 45 percent

play14:02

down to up is 57 and down to down is 42.

play14:06

so the best performing is an update

play14:09

after a down day so that is 57 so if I'm

play14:12

going to take any bet in all these four

play14:14

conditions my bet will be to go uh for

play14:17

an update after a down day because

play14:19

there's a 50 57 chance for that to work

play14:21

out uh now down to down is significantly

play14:25

lower so it's just 42 so there is

play14:27

nothing significant for us to uh you

play14:30

know make a trade in so in all these

play14:31

numbers these numbers are not that

play14:33

significant it's on the 50 40 area so I

play14:36

want something more effective

play14:37

so let's do another one let's do what's

play14:40

the probability of update if there is

play14:43

five consecutive down days so down day

play14:46

down day down day down day down day and

play14:49

then we divide it by the length

play14:52

tier again length of the uh five or six

play14:56

down days and what is the probability of

play14:57

that so that probability is 66 percent

play15:00

now that is a pretty good probability

play15:03

six to six percent is something that I

play15:05

can work with so what I'm going to do is

play15:07

I'm going to take this information that

play15:09

I've got like five to six days of down

play15:11

days and the probability of the next day

play15:13

being an update is pretty good so I'm

play15:15

going to take this information and I'm

play15:16

going to back test it so nine times out

play15:18

of ten I would back test in Army broker

play15:20

but now just to make things simple I'm

play15:22

just going to go into Pine editor and

play15:24

I'm going to do a condition where close

play15:26

is less than one close to one is less

play15:28

than close with two so basically

play15:29

yesterday's close is lower than the

play15:30

prior day so we've got that condition

play15:32

for five to six days

play15:34

and that is our entry if that condition

play15:36

is met and then we are going to close

play15:39

our position

play15:41

if the next day close is higher than uh

play15:45

today's scores so it's pretty simple and

play15:48

you can create a markup model for the

play15:50

exit condition as well so what is the

play15:52

probability of us having a greater

play15:54

return if the close is tomorrow or two

play15:57

days later so then we can calculate a

play15:59

better probability and create even

play16:00

better strategy so when you run this

play16:03

strategy you would see the result as 46

play16:05

with a drawdown of just five percent so

play16:07

this is not at all significant when you

play16:10

look at simple terms but when you look

play16:12

in the overall perspective it's pretty

play16:14

good because you can see there's only 20

play16:16

trays placed if that's from 1994. and

play16:19

it's only based on one condition so

play16:21

imagine if you create multiple

play16:22

conditions or Marco models so here we

play16:24

did six days of consecutive close below

play16:27

so what about five days what about four

play16:29

days what about a combination like up

play16:32

down up followed by an update or down

play16:35

down up followed by an updates then you

play16:37

can add up more and more conditions uh

play16:39

if the probability is suiting you will

play16:41

like 60 up and then your net profit

play16:44

starts clamping up and up and up again

play16:46

and because you've got more conditions

play16:48

the drawdowns start to uh be better as

play16:51

well because if you're basing it on just

play16:53

one strategy then the drawdowns won't be

play16:55

that significant so you need to have

play16:57

more strategy so we did the video uh

play16:59

just the prior video the gpt4 where we

play17:01

did a strategy wherein we had a strategy

play17:04

applied to 25 stocks and also 90 stocks

play17:07

and how we were able to reduce the

play17:08

drawdown considerably just by doing the

play17:12

strategy in multiple stocks similarly if

play17:14

you can add more conditions to this this

play17:16

will be spectacular so the whole idea of

play17:19

this video is for you guys to understand

play17:21

what a Markov process is to code it in

play17:24

Python and then apply it in your trading

play17:27

goal so for example the Q5 strategy that

play17:31

we did in our course if you can look at

play17:33

it

play17:35

um because it's a mean inverting

play17:36

strategy and also the fact that it's

play17:39

kind of inspired from the markovia model

play17:40

you can see how amazingly it performs so

play17:43

this is the 2001 dot combo where the

play17:45

market is crashed considerably well and

play17:46

you can see it's literally a diagonal uh

play17:49

you know literally across uh similarly

play17:51

here again 2008 crash where it went down

play17:53

54 and look at the results of that

play17:55

strategy again recently past two years

play17:58

uh the market went down and this

play18:00

strategy has outperformed the market and

play18:01

the drawdown is quite minimal as well so

play18:03

this is the advantage of Mercury model

play18:05

so in this strategy I took the markovi

play18:07

model and I effectively did I don't want

play18:10

to give out much information about it

play18:12

but the people who know the course uh

play18:14

know how I combine two different things

play18:15

I've chosen the days similar to what we

play18:18

saw here

play18:21

uh the close is less than one kind of

play18:22

thing but then I use the exit condition

play18:25

to be slightly tweaked

play18:27

um so these are some of the things that

play18:28

you can efficiently do in creating good

play18:31

strategies great strategies based on

play18:32

good probabilities so in this case we've

play18:34

got a 66 probability and that why it

play18:36

kind of worked so even if I go to the

play18:39

ETF of QQQ again you will see a 21

play18:41

return and Microsoft and one button and

play18:44

the list just goes on so you will

play18:46

basically see just start bit just based

play18:47

on one condition right so imagine having

play18:49

multiple conditions and applying this to

play18:51

multiple stocks and this is pretty much

play18:52

what Jim Smith is doing and we don't

play18:55

know exactly what he's doing but all we

play18:57

can do is to get information from the

play18:59

book information from any kind of

play19:01

interviews he does you know combined

play19:02

together and kind of improve but

play19:05

regardless when you're in a Quant

play19:06

trading Journey you're trying to get the

play19:08

probabilities in your favor so any tool

play19:10

including the markovian process and

play19:13

calculate the transition properties is

play19:14

highly efficient so in this case we

play19:16

actually

play19:18

did you know just based on historical

play19:20

data probabilities now you can actually

play19:23

tweak that to use a machine learning

play19:25

model to calculate the probabilities of

play19:26

these you can go a step further create a

play19:29

for Loop and change these down datas and

play19:32

you know down and up to different

play19:35

combinations and calculate more

play19:36

properties create a massive Matrix not

play19:38

just up up down like you know like 10 10

play19:41

rows here 10 10 columns there and then

play19:44

uh you can tweak the data points you

play19:47

know instead of this you can actually do

play19:48

the recession environment so you can

play19:50

create a recessionary based environment

play19:51

strategy or Trend following strategy so

play19:54

the sky is the limit when you have data

play19:56

and when you have the tools and the

play19:58

skills to process it so I hope you guys

play19:59

like this video if you have any queries

play20:01

any uh any doubts or clarifications feel

play20:05

free to leave a comment and I'll be more

play20:07

than happy to help you guys out so hope

play20:09

you guys enjoy this video have a great

play20:11

great day bye-bye

Rate This

5.0 / 5 (0 votes)

您是否需要英文摘要?