0:00
hello there fellow data scientists algo trader or just curious person
0:05
if you're interested in making money in the markets if you've come to the right place my name is leo and i'm an algorithmic trader and today we're going
0:12
to back test scotland's slingshot trading setup if you're not sure who scotland is scotland is a professional
0:18
trader with multiple triple digit returns under his belt with his highest being 302 in this year clocking at 150
0:26
and i know that's pretty much certain because today's december 31st 2021 so
0:31
150 annualized if you're not familiar with the setup i created a analyzing
0:36
alpha tv episode right here these are just more bite-sized to understand trading and not really dig into the code
0:43
if it's related to code and back testing data science ai all of that stuff that is this channel and instead of me
0:50
digressing why don't we get to the code okay so the first thing i'm going to do is import since i want to grab some of
0:56
the custom code that we previously created and since i'm creating this notebook out of
1:03
a different directory i need to append the proper directory to the python path
1:09
and this is how you let python know where your code modules are so
1:15
home let's migrate development okay i enter so now we have access to all those
1:22
previous code you know custom code we created now let's briefly talk about the scotland
1:28
uh slingshot strategy mainly in the algorithmic sense because if you're
1:34
interested in the slingshot go ahead and check out uh you know this video here uh where i go a
1:40
little bit more in depth but anyways what are we doing we need to first grab our universe of stocks universe is the
1:46
qqq and we filter these stocks
1:53
above 50 sma and then the entry
2:01
uh let's see end this is fine okay filter
2:06
i'm gonna stock well above
2:12
or ema the highs could be hourly or daily
2:22
and then the exit is the low of the trigger bar
2:28
okay so that could be hourly or daily also
2:34
and then whenever we don't um date whether it's open high low or close
2:40
it's just it's assumed that it's a close just so you know okay all right so first things first we need
2:45
to get our imports we'll do get imports
2:52
import date time as dt import numpy fmp
2:57
import pandas as pd from source models that api imports that
3:03
particulars and get lit bars and this just gets us the data out of that
3:09
database that we've already created hit enter that looks great we'll now set the time frame
3:16
let's see god see set time frame
3:26
and you can obviously back test this for as much as you want but we'll do 2020101
3:31
and keep in mind i know that the two years
3:39
i know that qqq's been on tear here so you're going to want to test this stuff over
3:44
multiple time frames uh but the idea here uh with the vectorized backtest you just get an idea
3:50
does this setup work and uh you know like the pullback setup so it does
3:56
let's see here create universe so what we'll do here is i'm going to web scrape
4:01
um you know just to show you how to web scrape the qqq from uh invesco so we'll do
4:09
import csv import request i would recommend in in the future if
4:16
you're you know serious about this stuff you add this to your database too i'll say the url that's the url for
4:23
invesco and now i'm just going to copy this code here i'll briefly cover it
4:30
but i don't want to waste your time so anyways we just open up a session
4:35
and then we get the url which is up here and then we decode it we split on you
4:40
know the commas uh we couldn't use um ed.read csv for pandas but basically
4:47
this code essentially downloads it puts it in a data frame strips off uh one of the incorrect
4:54
uh you know the incorrect header right and then adds the header which is right here
5:00
and when we hit enter we now have eq for the current date now
5:06
keep in mind again this is the current qqq so anything that drops out would not be in our back test so because
5:13
we're going long essentially there is a little bit of
5:19
survivor bias here so just something to be aware of and then also that's why you
5:24
want to put this stuff in your database so you can ensure that you have the historical components and of the qqq and
5:32
not just the existing constituents hopefully that makes sense but now let's just grab the
5:37
tickers udf let's see what does that say holding ticker right there okay df
5:45
holding ticker i'll use the string method strip because i know there's some spaces in
5:51
there that shouldn't be sort values just because i like them to be sorted do list and then tickers so
5:59
there we go so now we have all of our tickers which we'll then use to get our bar data
6:06
and we're going to do that next number we on f3 4 okay
6:13
one two three four bar data okay so it'll be bars one m get
6:20
minute bars rippers start and i'm using polygon you
6:27
get my data here but basically you can use any source you know you
6:32
don't even necessarily need to use minute data if you have hourly or daily you can just test on the
6:38
you know on those time frames but we're going to use the minute data and then we're going to
6:44
resample them you get the appropriate time frame this will take a minute so i'm going to
6:51
fast forward missed now we can see that our bar data is populated with the multi index the level
6:57
0 is the ticker level 1 is date and we have open high low closing volume
7:02
for the columns and one of the things that we need to discuss that we didn't have to i guess cover in the crypto price year
7:09
trading video because crypto trades 24 7 on the utc time frame or
7:17
is that the stock market opens up different times of the year relative to utc which is the time zone that most of
7:26
the data is provided in by data providers and this can cause challenges when we try to resample and align the
7:32
data properly because the time is different let's go ahead and see exactly what i mean first we'll go ahead and
7:47
you'll notice now we have ticker and date as columns
7:52
now i believe the daylight savings time was uh april 14th so the bars 1m bars 1m
8:02
date where the date is less than 2021.03 14.
8:09
we can see that the stock market opens at 14 30 utc
8:14
now i'll copy this paste this let's make it greater than
8:21
and equal to now we can see that the stock market opens at 13 30. so 14 30 13 30. that
8:31
would cause some problems in the future now one thing that we also can take a look at is
8:37
when the daylight savings time begins we'll do bars
8:42
1m date greater than equal to
8:47
21 1107 okay so that's when it begins and now we see
8:54
it's back to 14 30. so that's just something that we need to consider so how do we handle this well
9:01
what we need to do is we need to convert the time zone before we resample
9:06
let's go ahead and do that now the bar is one m date equals bars one m
9:13
eight we use the date time methods easy invert
9:19
america new york right and then it can be bars 1m and
9:25
notice what we see now now you can see we have the time zone and eastern time
9:31
is 5 hours behind utc now what we can do is let's go back up
9:37
to here and grab this and see what we see
9:46
and now we see it minus 4 and just not to letter everything up
9:51
we see minus five so now we have the correct time zone in place and we can
9:57
merge now on 1930 and that will align appropriately
10:04
let's go ahead and get everything set up back to the format that we want
10:09
and now we'll go ahead and type bars 1m bars 1 m dot set
10:15
index asset date and ticker and
10:21
i'll put that to the screen and now we can see that we have the date and the ticker you'll
10:27
notice i actually rearranged that and you'll see why in a minute but basically now we see
10:33
the time zone has been added to the index here or the level index for the
10:38
date but with our dates organized the way that we want them to be it's now time to create the indicators
10:46
now the reason we create the indicators here is that way we can apply it to them to multiple time
10:53
frames great indicators
10:58
say ema four is equal to lambda x where x ewm span equals four min periods
11:07
equal four just equals false ignore n a equals false okay that's
11:14
pretty simple now we'll do ema 10 equals lambda x we want we want to make sure that
11:21
we're in a downtrend so we want lambda x we'll be we're going to use this for the daily so
11:27
the close is going to be below the 10 period ema so min period 10.
11:35
i'm going to span first band and min periods
11:41
and adjust false north and a false
11:47
and then the sma 50 lambda x x dot rolling
11:53
50 mean but now these are really the three indicators that i put that up here
11:59
um both are stocks above they're 50 and they'll also do filter
12:06
where stocks below and ema
12:17
so when me not man hit enter perfect
12:23
now we go ahead and resample the time frames create a heading here
12:37
first create a aggregation dictionary and what that does it just tells pandas
12:42
what we need to do with each column right because we're taking minute data and turning that into hourly data and we
12:49
need to know well what is the open for the you know for the hourly bar so for
12:55
instance make this more concrete open would be the first data point right
13:01
i is the max low is the min
13:10
close is the left and the volume is the sum
13:20
now that we have that completed what we want to do now is create our hourly bar so we'll say bars 1x equals bars 1m
13:27
because we're resampling from the minute bars we want to group by both
13:32
the hour time period right and also the ticker so we can use pd
13:39
grouper level 0 which is the time we do frequency
13:44
1h for one hour and we're going to use label equals left now with that we don't
13:51
necessarily need to specify this but i want to be explicit if you think about a daily time frame
13:57
the it has a period right the beginning is the morning or when you know the day first takes over so that would be at
14:03
zero minutes and then the end of the day would be at you know the last minute or tomorrow exclusive so
14:11
that's what that label means
14:19
frequency label there we go because this should be you
14:25
know lift together so all right perfect all right ipd grouper
14:30
level one so that is now the picker right
14:36
and i'll bring this back here group that so the group buys all together so we have the group by we're
14:42
passing the list of grouper objects the first one is level zero which is the time the second one is level one which
14:49
is the ticker and we pass in the dictionary on how to determine
14:54
um you know the aggregations the average method okay
15:00
and rs 1 8 also create the indicators of this point so ema 4
15:06
is the bars 1h group by because we want to always group by the ticker when performing these operations so we don't
15:13
accidentally have the let's say google's or pure dma be calculated from part of
15:20
apple's price if that makes sense i and then we want to apply the
15:25
a function now what we'll do is since we already know we're going to have a bunch of
15:32
uh null values because you know the ema 4 takes four periods to calculate that first value we can drop
15:40
all of the data using a subset ma4 so this will drop all of the na
15:46
values that show up for all of the rows where the na values show up in the ema 4
15:52
period column now we'll do bars one h columns
15:57
we're gonna have both hourly and daily bars so we want to make sure we specify or be able to
16:03
easily determine which bars are which so we'll just append this or c in bar one
16:09
eight columns and we'll type bars one h and hit enter
16:14
and hopefully this works and it does so what we can see now is we see the date
16:21
by hour right and we do see our time zone it's times unaware now and then our ticker
16:27
and then our hourly values plus the ema for one h we should be able to also determine
16:36
we have any null values meaning there is no sum and that's good because we did the drop
16:44
at a up above there hopefully that makes sense okay and now it's time to create those daily bars and now instead of
16:50
retyping everything since i just explained it i'll just copy and paste
16:56
as you understand the concepts here and what we'll do is we need to still modify this because remember
17:03
we're going to use the 50 period sma and the 10 period ema right so we'll
17:09
do this right here so first i'll switch everything to daily so don't forget
17:15
okay frequency 1d r is 1d i know that needs to be changed
17:37
okay and now we need to add the appropriate indicators i'll keep the email with the highs
17:44
just if you want to check out or test out that version
17:49
we'll do ema m this will be
17:55
the close and the sma
18:00
50 okay which is the close
18:07
and then when you update this press may
18:13
and we only need to drop the 50 because we know that the 50 takes up more periods
18:19
than any of the other versions right 10 that's 10 period that's four period as far as 1d
18:25
so let's do bars one h okay just checking to make sure i didn't forget anything there and then i hit
18:32
enter and that should give us our daily bars it looks like it does
18:38
perfect and now we'll check to see r is one b is null just like we did
18:44
before sum we have any null values and no we don't so it looks
18:49
like we're good there but there's one challenge here so if you look at the time frame
18:55
right when does the daily blockers open they start at 9 30 eastern so what we need to do is we need
19:01
to align those and that's pretty easy to do so just to type bars 1d
19:07
reset the index right so we can access the date we'll then take the date
19:15
and we will add an offset
19:20
which is hours equals 15 rs 1d
19:25
bars 1d set index we're just setting the index back so all we did is we added an offset
19:31
because we know that the stock market doesn't open at 0 hours it opens later on and
19:39
more specifically you know this is 15 hours after you know the
19:46
zero here so which would be the end of the day because we want to merge the bars on the end of the day not the
19:52
opening because think about it you can't know the close of that day right the close of
19:58
the daily bar until the close of that day so that's why we're doing 15
20:05
hours and what i do here bars one d date bar is not defined
20:12
there we go okay so perfect so now we have the bars
20:18
which have a timestamp essentially of the close
20:24
which is you know should line up with the hourly bars you know the last hourly bar which is
20:30
also 15. so hopefully that that makes sense all right so now that we have the time
20:38
frames uh the both of the bars you know the hourly bars and the daily bars it's time
20:43
to merge the time frames let's go ahead and create the heading
20:48
here merge time frames i think we're on seven
21:00
all right now one thing i want to show you is how to access the first date
21:06
right so if we do print bars 1d index we get that first element you'll see
21:11
what this looks like and we see it's a timestamp and it has multiple different data
21:17
within it but we want the first element which is that time right
21:24
now we can go ahead and copy this and paste it three times to get the starting
21:29
and ending boundaries so this would be the start of the hourly
21:34
and negative one would be the end right
21:40
and hourly so we hit enter here and we can see that the data frames are almost aligned the
21:47
hourly is behind the daily which makes sense because
21:53
right the sma daily creates a lot of null values relative to the hourly okay
21:59
so now what we need to do is simply align these which is pretty easy we'll first reset the indices bars one h
22:07
partite reset index bar is one d part 1b reset index
22:14
perfect and now what we need to do is we'll just slice the
22:19
hourly bars to remove those you know anything that
22:24
doesn't align with the daily so the bars one h date
22:30
where the bars one d date
22:35
men okay so let's take a look and think about what we're doing here so the bar
22:41
the hourly date has to be greater than or equal to the minimum daily date right
22:47
and then this just gets all of the columns so that should align that and when i do here
22:55
oops we dot lock now what i'll do is i'll
23:00
just print out the start and end dates again and this time since we reset the indices
23:08
they'll actually we'll use a different command because we're accessing the column and not the
23:14
index so this would be one h
23:22
and this would be negative one because we want to get the last element
23:28
one h and they should all be aligned and that they are and we have that time zone
23:34
information too perfect okay so the next thing we need to do is just create a bars data frame that
23:40
merges both the hourly and the daily so we'll type bars equal bars 1h merge
23:47
we want to merge with the bars 1d on and we're going to merge on the date
23:54
and the ticker and then how is left because we know the hourly will include or is inclusive of
24:01
all of the daily bars but the challenge is going to have a bunch of null values for the daily but let's go ahead and
24:10
fix that and we'll do that by filling them so bars 1d columns so we're going to grab the
24:17
daily columns we're going to group by the ticker and then we'll apply this to the daily columns
24:24
we're going to transform them and x
24:29
x or fill hard to see the two f's there
24:35
okay and then we just set everything back bars set index date thicker
24:42
and bars and now we see that it is indeed looking like it's working we've got all
24:49
of our column headings up here with our different moving averages and everything should be filled but
24:56
let's verify that we do that by typing bars swap level one zero so we're
25:01
swapping the uh indices right so we're getting the ticker first so we're taking a cross
25:07
section grab the apple ticker is null
25:12
and sum to see if there are any null values and there shouldn't be and we are good so now we're on to the next step
25:19
which is creating the signals create a title here do create signal
25:27
okay and now let's go ahead and create that we'll do bars entry signal
25:32
equals and then we've got a few uh different things we have to consider here so first we want strong stocks in
25:39
an uptrend and we define that as being above the closed price being above the 50-day simple moving average so close 1d
25:47
is greater than bars sma 50 1d
25:52
and and we want stocks that are in a temporary hopefully a town trend bars
26:05
10 1b there's all sorts of stuff you could do with that you could look at range compression and stuff like
26:12
that using atr but anyways again we're just covering the slingshot here with
26:18
these basic parameters so now that we have strong stocks in uptrend with a slight pullback
26:25
now what we want to do is we want to get that slingshot entry where the hourly close is above the four hour ema
26:32
crossover and the crossover is key i'll show you why in a second so we've got bars close one hour
26:39
is greater than bars ema for one hour
26:45
and we want bars group by thicker and we have the group
26:53
so basically we want to make sure that this right here right did not occur on the prior bar so
26:59
we have to group by the ticker to make sure that we're not accidentally mixing tickers when calculating emas so e uh
27:06
close 1h shift again it's just the same thing as
27:11
the above but we're just shifting the data by one and then bars root by
27:19
picker and now it's the ema for one hour
27:24
shift perfect and hopefully i didn't make any typos there and hit enter and see if that does
27:31
create the signal and it does appear that it may have but we see only false data so what
27:38
we want to do now is let's go ahead and determine if there is indeed any entries
27:43
so we didn't make a potential mistake there but entry signal
27:49
is equal to true and it does look like we did get some
27:54
cruiser over there and let's see here so we've got zoom i think it's gilead viserv
28:01
let's see here so let's take this one right here and you'll see why because what i want to do
28:08
is just take a look at these signals so we'll do bars swap level
28:14
1 0 dot xs and then gild right so that'll just pull
28:22
you know the gilead data and then we want to select a time frame
28:28
and we can do that using slicing because level 0 is the time data
28:34
so 20 20 0 3 14 and now i want to go back one
28:42
hour earlier whoops placing
28:48
okay and now what we can see when we go to the entry signal we have a false
28:54
right we want to make sure we get one before then and then true and then false so we're making sure that the crossover work okay and now it's time to analyze
29:01
the results and heading and lines for results
29:06
and let me kind of go at a high level of what we're going to do here i mean there's obviously more sophisticated
29:12
ways to do this i you know for every demonstration what i want to do is kind of focus on a
29:18
key part right in this video it really was you know understanding how to align
29:23
the time frames and merge and whatnot for equities because that's pretty important even though it's not using crypto
29:29
you know i know there's more sophisticated ways to do what we're about to do and we're going to just be looping
29:35
through things to make it easy but i just don't want these things to drag
29:40
on because you know it's already getting pretty long so anyways i'm digressing but i just want to let you know there's
29:46
better ways to do this and different things that we can analyze but all we're going to do is we're going to loop through 10 times for each risk
29:53
reward ratio one through ten okay in fact i'll i'll just type this in right here
29:59
i will do list we'll use list comprehension r4 r in range one to
30:04
eleven oh one to 10. now what we're going to do is we're going to have a dictionary
30:10
called stats and then inside that we'll have another dictionary where we kind of keep all those stats
30:16
and we're just going to loop through each ticker and then for each ticker we're going to loop through each bar now the important thing to understand when
30:23
we're doing this is that we have to get this signal on the one bar right and then take the trade on the
30:29
next bar you can't take a trade on the same bar that you get your signal that would be looking ahead or look ahead bias and
30:36
you'd see some great results but whenever you tried to put this in your event driven back tester or try to lime
30:41
trade it your results wouldn't be nearly as good so anyways so first create that no an apparent dictionary
30:48
or jnrr so it just loops this through 10 times we'll create a list
30:54
for our trades okay and now there's a few variables that we want to uh keep track of or keep
31:01
track of the maximum one like basically a win counter and a loss counter
31:07
okay and now what we'll do is we'll just simply loop through each ticker so for ticker and
31:13
bars root by level one right and we're grouping by level one
31:19
because that is our ticker so okay
31:24
so this will give us the data for each um for each ticker say risk reward is j so we'll start off
31:32
at one two three four five you get the idea we're just going to count the number of wins
31:40
number of losses the number of consecutive wins
31:45
and consecutive lost okay we'll also say position equals false
31:50
and take position these are just flags that we're we're
31:56
going to use right um to track things so now that we have the data for each ticker we want to loop
32:02
through each bar so for i r and data it arose
32:08
if take position remember we're going to with the signal actually
32:14
maybe i'll maybe i'll no no okay so remember the signal is going to happen at the end of the loop but if baked
32:20
position equals true right now what do we want to do if we
32:27
want to take position right we want to set our entry price which will be at the open we want to set
32:32
our risk and then we want to say position is true and take position as false right because we've already taken the
32:38
position so the entry price is equal to the open
32:44
because we're using the hourly bars right and this would likely be the the close of the prior bar but you get the
32:50
idea and then what we're going to do is set our entry risk so entry risk is equal to
32:56
the entry price minus the stock price right pretty simple stuff
33:02
and you'll see the stock price will be set uh on the the last portion of this loop
33:08
and now since we've taken a position position is equal to true and we don't
33:13
want to take the position on the next one because we'll already have a position so we'll do false okay but now what we want to do is we want to
33:21
handle when we have a position if we're going to stop out or take profit so that's all we're doing next we'll do if
33:27
position is equal to true then if r closed one hour is less than
33:34
the stop price right we lost so we'll add to our loss counter
33:41
we'll add to our consecutive loss counter and we'll say the max 1 because now if
33:47
we had a winning streak we want to track that so max one is equal to max one
33:55
if max one is greater than consecutive one else consecutive one right so basically what
34:02
we're doing here is we're saying well max one is equal to our prior max one unless our now consecutive one
34:10
is greater so hopefully that makes sense and now we have to zero this out equals zero and then
34:16
position equals false now this handles our stop out
34:23
now the only other side of this if condition else if the close that the preferable
34:30
portion the close of the one hour is greater than our entry price
34:36
plus our entry risk times our risk reward right
34:42
so now if that's the case and let me scroll down here what we want to do is we essentially do the same as we just
34:48
as above we add to our one column we create or add another to our consecutive
34:56
one we then set our max
35:02
lost is equal to max loss if max loss is greater than consecutive
35:09
lost else consecutive lost okay and now what we need to do again
35:15
just like above consecutive loss is equal to zero and position is equal to false now we
35:22
need to do our entry signal right so if entry signal
35:28
is equal equal to true right that's part of our data frame and position is equal equal to false
35:35
we want to take position is equal to true so that's our take position flag
35:45
low on h that gives us our stop price and our take position
35:51
uh entry which will then get caught on the next bar assuming there is one and now we'll just close it all out
35:59
position is false max 1 max 1 f max 1 is greater than
36:04
consecutive one else consecutive 1 max loss is equal to max loss if max loss is
36:11
greater than consecutive loss val's consecutive loss and now we want to append all the data the trades append
36:20
we'll just make a list particular one lost perfect and now for every risk reward
36:27
level right because this is just for you know that risk reward level so we want to track that so we'll do stats j
36:35
for each risk reward level we'll create another dictionary so we'll have nist and stats j
36:42
trade equal to trades that's j
36:48
win streak equal to max1 that's j
36:55
blues freak a little max lost
37:01
perfect and now what we need to do we'll just output that on this line here and see
37:08
how many errors i made position i misspell this position is not defined
37:22
okay and then this will go ahead and loop through this 10 times and do all this logic and hopefully we'll have a
37:28
nice dictionary that we can then convert to a data frame and analyze
37:34
okay now that looks like that populated you can see the uh data output here so you know the risk
37:41
reward ratio is the key and then you have all the data with that nested dictionary lots of data
37:46
so i'm just going to scroll down here obviously this isn't in the best format right
37:53
so let's go ahead and make it a little bit easier to read so we'll do that by creating a data frame so we'll do data
38:00
equal tv data frame and then for key value in stats items
38:09
we'll say df equals pv beta frame make the value
38:14
the trade and then we'll say df with reward is equal to k which is another key
38:22
and then df win streak is equal to
38:28
win streak and what we're going to aggregate this in a little bit so you'll see what i'm
38:33
doing here and it makes it like why are you just copying this over um making the whole column that but
38:40
you'll see what i'm doing blue streak and then let's just name the columns the
38:46
columns we should have thicker one lost
38:51
with reward win streak and lose
38:57
freak and data equal data appends or it's appending the df
39:04
that we you know loop through for each risk ward level and now like
39:09
beta here that should make it easier to see so now we have
39:15
each ticker number one wins number of losses you know which risk reward level
39:20
was it the win streak the lose streak so this is great but likely you're going to want to get the aggregate statistics
39:27
right so let's go ahead and create some summary stats with sum stats equal data
39:33
group by we want to group by the risk reward go aggregate this we will want the
39:39
1 will be summed right
39:44
then we want the lost sum and then the win streak it really
39:50
doesn't matter right so we'll do win streak we'll just say first
39:57
and then for fun we'll just make the next one wins blue streak
40:05
last okay and now what we'll do is we'll say sum stats
40:11
total is equal to the sum stats 1
40:17
plus sum stats loss and now we'll have the total trades and what else do we want let's get the
40:23
win percentage so some stats when earth will call it is equal to sum stats 1
40:31
divided by sum stats total
40:38
that's some stats let's equal those sum stats dot reset index
40:45
and now we got some stats and now we have each risk reward level
40:51
grouped together have the total one total loss win streak lose streak and win
40:56
percentage right so now we're getting somewhere so let's go ahead and now add edge
41:02
right so we'll say sum stats edge
41:07
is equal to sum stats win perk times
41:13
thumbstats risk reward minus
41:18
1 minus some stats when right so this is just the the losing
41:26
ratio and this for fun we'll just say times one because if you think about it um a risk
41:32
reward level or risk reward ratio is always a you know one risk to how
41:38
much reward so we're just going to multiply by one here i never take a profit less than
41:44
uh the risk right so one is fine here so one is picked
41:49
hopefully that makes sense and now what we'll do is we'll just hit that actually
41:55
some stats hit enter here and now we have our edge right so basically what we're doing is
42:01
every time we flip a coin or enter a trade this is the expected so you might
42:07
say well wow leo the edge is really great up here we should just you know set our risk reward levels to
42:14
10 well you also have to keep in mind this losing streak so you have to do some a little bit more advanced math to determine what uh you know your risk
42:22
tolerance and whatnot and again one thing to keep in mind here this is a very whenever you're prototyping this stuff
42:28
and this is what i call prototyping when we're using a vectorized back testing system instead of an event driven event
42:34
driven loops through every single bar doesn't have lookahead bias and you can model things more in depth maybe you'll
42:39
create actually i will create a video on versus event driven back testing but
42:46
basically with pandas and python the goal is to get an understanding whether or not this setup works and it does
42:51
indeed look like it does and we made this entry signal pretty not naive but if you
42:56
look at the video on the slingshot you can understand there's also we want rain
43:02
compression and other stuff too so we could potentially do a range break using highs and lows
43:08
pivot points so there's all sorts more stuff that we can do but this is this goal of the video was to get a basic
43:13
understanding of whether this pullback strategy works it does have an edge but at this point you would want to
43:20
model this further so hopefully that makes sense and hopefully you enjoyed