Improve Your Trading Strategies with a Monte Carlo Simulator - YouTube

Channel: Mark Ursell

[0]
hello this is mark from trade inform
[2]
comm and welcome to this video on how to
[5]
improve your trading strategies using a
[9]
Monte Carlo simulator okay what I'm
[14]
going to show in this video is how that
[16]
you can create or yourself using
[19]
Microsoft Excel a type of Monte Carlo
[22]
simulator that will rearrange and
[25]
randomize the results of a back test
[29]
with the intention of checking the
[32]
robustness of your maximum drawdown okay
[36]
so all you need to do to start this is
[38]
an actual back test that has been
[40]
carried out and we've got the results of
[42]
this shown in this column ad it's not a
[47]
brand new page here and the only thing
[50]
I've included on here is the number
[52]
there were signed each of our trades a
[54]
number and I put in a heading here
[58]
original trades our original antiquity
[66]
original maximum drawdown okay so our
[73]
original trades we're just going to link
[75]
to this spreadsheet so we're going to
[78]
just put in equals I'm going to link to
[80]
this column this cell here press Enter
[85]
I'm gonna remove these dollar signs so
[90]
that what we can do is just double click
[94]
on the bottom right hand corner of the
[95]
cell click on calculate and Excel will
[99]
include the cells here in this column so
[104]
I don't need this spreadsheet so I'm
[106]
going to close it okay so our original
[109]
equity we're going to start off with one
[113]
thousand dollars and when we get to
[117]
trades positive and negative trades are
[120]
then to add to this now I'm going to
[124]
copy this down again by double-clicking
[126]
on
[127]
bottom right hand corner of the cell
[131]
next from this column I'm going to
[133]
calculate our maximum drawdown for the
[136]
original back test we're going to do
[139]
this by the formula equals this cell
[143]
divided by max which for Excel stands
[147]
for the highest correct this c2 c2 I'm
[155]
gonna make the first one of these fixed
[157]
using f4 and put all of this in brackets
[162]
and I take one minus and then I'm gonna
[168]
double click and copy it down to all the
[171]
cells below okay so the next element I'm
[176]
going to introduce in the spreadsheet is
[179]
the first part of the monte carlo
[180]
simulator and we're going to need an
[183]
element of randomness so we're going to
[186]
use the excel formula i and do with
[189]
brackets and this automatically
[192]
generates a random number between 0 and
[196]
1 with 15 digits after the decimal point
[202]
copy this down and again like that
[206]
and in the next cell i'm going to use
[209]
another excel formula called rank i'm
[213]
gonna click on here do a comma and we're
[217]
gonna highlight our entire range of
[220]
random numbers close the formula now go
[227]
back into it and i'm gonna press f4 to
[231]
make this fixed press Enter
[235]
we can click this down so now if I click
[239]
on the calculate button again we have a
[242]
new order for our trades okay so now
[248]
with the next thing we need to have in
[250]
here is our new trades need our new
[254]
equity and our new maximum drawdown okay
[262]
to calculate our new trades or the
[264]
position of our new trades using our
[266]
random and rank function going to use
[269]
another excel function called vlookup
[275]
I'm going to ask it to look up this
[277]
value here you can asked it to look it
[280]
up and this right here just columns a
[287]
and B
[291]
I'm going to ask it to check in the
[293]
second of these columns and before I
[300]
copy this down I want to use f4 again to
[304]
make these this array a fixed array so
[309]
now I can click on calculate and Excel
[313]
has automatically moved our new trades
[318]
in the relative position of the new
[320]
randomized order okay so our new equity
[325]
we're going to calculate in the same way
[327]
as our original equity so I'm going to
[329]
price control C move that over here
[333]
double click undo maximum drawdown again
[340]
I'm gonna cheat and use this function
[343]
here just drag this across here
[354]
and double-click to copy the formula
[356]
down to all the sounds below
[366]
okay so here what I'm going to do is I'm
[369]
going to calculate our prophet a prophet
[373]
is going to say the same in both the
[375]
original and the new versions this is
[379]
because we're keeping all the same
[381]
trades this particular monte carlo
[383]
simulator is only randomizing and
[386]
rearranging that order so we're gonna do
[390]
this by formulas um this range here all
[401]
our original trades center then we're
[406]
gonna calculate our original maximum
[412]
drawdown yeah we use the max function
[418]
again this range and we're gonna have
[429]
our new maximum drawdown equals maximum
[437]
it will be this range
[446]
and that's our press calculate we'll
[449]
find we get a new value here and every
[452]
time I press calculate or in fact enter
[457]
something new I go onto formulas and
[460]
calculate we'll get a new value for our
[465]
maximum drawdown well we can show this
[468]
visually quite easily as well by going
[472]
down here pressing insert and then we
[479]
have a line graph
[488]
showing original equity charts if I just
[493]
copy this paste it here click in it and
[501]
drag it over to our new drawdown they
[505]
have a visual representation of our new
[507]
drawdown and again if I go on to
[510]
formulas calculate we can see that the
[515]
graph of our drawdown changes one thing
[521]
you want to do when you're using a Monte
[525]
Carlo simulator is test multiples of
[529]
different scenarios so we could easily
[534]
do this manually we could just click on
[536]
this but what we would prefer to do is
[540]
run a number of scenarios automatically
[543]
it's what I've done to speed things up a
[546]
bit in this spreadsheet is use a
[549]
recorded macro and I'm going to go on to
[552]
macros and click run and so what it's
[557]
going to do the screen now is do 20
[559]
versions and we can see it updating
[562]
there and updating on the right-hand
[565]
side in real time the different equity
[570]
curves for the different scenarios so
[574]
while my computer is chugging through
[576]
these difference scenarios and say that
[580]
if you are interested and using Excel to
[582]
back test trading strategies
[584]
I do have an e-book course available the
[587]
Amazon Kindle book store and there is a
[590]
link on the screen if you would like
[591]
more information about this course
[597]
so there I've used a macro it is
[599]
actually I'm not going to go through it
[601]
in this video but it is very easy to
[603]
record macro doing a simple task like
[606]
this going through and recording the
[610]
data for each scenario so what I'm going
[614]
what I do want to do below this is work
[616]
out a few metrics based on what this
[620]
data is telling is first of all the
[622]
average we can see that out of these 20
[627]
scenarios we've tested our average
[630]
drawdown is five point three three
[632]
percent which compares to our original
[635]
maximum drawdown which was 3.75 so we
[640]
can see straight away that our regional
[643]
strategy may have been just through pure
[647]
chance and may have been suggesting that
[651]
this strategy has a lower drawdown than
[653]
it would do in the future and use
[656]
another formula say the max function
[659]
again and this shows is that out of
[665]
these 20 scenarios the maximum or the
[669]
highest drawdown that was experienced in
[671]
all of them was eight point seven six
[674]
which is more than double our original
[676]
drawdown which again could be
[678]
significant you can do whatever metrics
[682]
you like to ensure to your own
[683]
satisfaction that you have a robust
[685]
trading strategy you may want to look at
[688]
a 85 or 95 percent percentile you may
[692]
want to look at the standard deviation
[694]
you may of course want to do a lot more
[696]
than 20 runs and you are of course
[700]
welcome to do that so I hope you found
[703]
this spreadsheet useful hope you found
[706]
this video useful guide in how to create
[710]
your own Monte Carlo simulator and if
[713]
you would like more information about
[715]
using itself to backtest trading
[717]
strategies and about financial markets
[719]
in general please go to
[723]
www.mwuclinics.com
[726]
you