0:00
let me give you a scenario and see if
0:01
this is familiar to you your algo
0:03
strategy has identified a trade
0:04
opportunity all the rules of the
0:05
strategy were fully satisfied and the
0:07
algo now confidently goes ahead and
0:08
places the buy order within a few
0:10
seconds the price reverses and your s is
0:12
hit sounds familiar right well this is
0:14
the story of most new algo Traders in
0:16
this video I'll explain one of the most
0:18
common reason why this is happening
0:20
we'll also talk about the trading 's
0:21
best support and resistance indicator
0:22
and how it can help the situation we'll
0:24
walk you through its python version that
0:26
I built I will also explain how you
0:28
could use this python utility for free
0:30
in your own algo and say goodbye to bad
0:31
trade entries so let's get
0:34
started this your first time here
0:36
welcome my name is VI and I'm a
0:38
financially independent Alo Trader this
0:39
channel is all about building a
0:40
community of algo Traders we discuss
0:42
everything about Alo trading using
0:43
python building and practiceing trading
0:44
strategies Market updates much more
0:47
please do visit our community website
0:49
trader.net Channel Fab wealth where I
0:52
talk about my own Financial Independence
0:53
journey and Shar tools methods and
0:55
strategies that help me achieve my
0:57
Financial Freedom thank you
1:00
during my initial days of algo trading I
1:02
used to run into that scenario very
1:03
often I used to think I have the perfect
1:05
strategy I've back tested it multiple
1:07
times my confidence was high and yet
1:09
when the first order went out within a
1:11
few seconds the price reversed and myel
1:12
was hit right it was a bit frustrating
1:15
because the wind ratio was nowhere
1:16
closer to what it looked like when I was
1:18
back testing it um I know the there's
1:21
nothing wrong with the strategy there's
1:22
nothing wrong with the timing of the
1:23
trade as well but what I did find out is
1:26
that the the problem was with the the
1:27
price point at which the order went out
1:29
most of often what happens is the buy
1:31
order is placed very close to an
1:33
existing resistance line so when the
1:35
price starts moving uh it hits that
1:37
resistance and then even if it is
1:39
temporarily pulling back uh you know you
1:41
your SL would hit and then the price
1:43
would start continuing in that direction
1:44
that you wanted it to similarly in case
1:46
of a sell order if you place it very
1:48
close to a support uh you would you
1:50
would end up with the same situation
1:51
where the the SL SL being
1:52
hit when I was looking for a solution to
1:55
this I came across this particular
1:56
wonderful trading view indicator called
1:58
the support resistance Dynamic by the
1:59
loansome blue I'm sure you aware of this
2:02
indicator is one of the most popular
2:03
indicator on trading view uh and one of
2:05
the most simplest and the accurate
2:07
indicators that you can come across the
2:09
way this indicator works is very simple
2:11
all it does is basically looks at all
2:13
the turning points of the prices and
2:15
then generates this various pivots and
2:17
then it also generates channels equal
2:18
size channels and then more pivots
2:21
within that channel indicates that you
2:22
know there's a lot of there's High
2:23
chances of price basically turning back
2:25
because in the history that that
2:27
particular Zone acted as either a
2:29
support or resistance and based on that
2:31
this indicator draws these uh Sr lines
2:34
and when I paper tested it it it worked
2:36
wonderfully well but now the the only
2:38
problem is this is in Pine script and
2:39
this is on trading view but my algo
2:41
platform is based on python uh so there
2:43
was no way I could use this indicator
2:44
directly there uh and that's when I had
2:46
to basically sit down and rewrite the
2:48
spine script into Python and this is the
2:50
python code uh for that indicator uh it
2:53
simply requires num and pandas as
2:55
dependencies to be installed um and the
2:57
way it works is pretty simple you give
2:58
it a symbol and then you you say what
3:01
time frame you need this on uh right now
3:03
I've given a daily candle and then you
3:05
can even go as low as 5 minute and then
3:08
it'll still work and then once you run
3:09
it it'll provide you the uh the support
3:12
and resistance levels as seen on the the
3:14
trading VI indicator this code is
3:16
available for you to freely download
3:18
this from our community website I'll
3:19
provide the link as usual in the
3:20
description uh the only change you might
3:22
have to do is currently I'm using zeroa
3:24
to get historic uh data so depending
3:27
upon which broker you're currently using
3:29
uh you know you may want to change the
3:30
code a little bit to get the historical
3:31
data so this this particular line is
3:33
what you might have to change this this
3:35
function is you'll have to replace it
3:36
with your own function to get the data U
3:39
apart from that the code works just fine
3:41
now that the the code is run let's try
3:42
and compare what we got here and see if
3:44
this is accurate with with what we see
3:47
view well on trading view we have these
3:49
five levels and this is exactly what the
3:51
the python also provided us so we know
3:54
that the the exact numbers match so we
3:55
know that the code really works uh so
3:57
now that you have the code you can run
3:58
it on your own for various uh
4:00
instruments and then please do give me
4:02
some feedback on how this is
4:05
working well now that we know that the
4:07
indicator is there the python version
4:09
works and all that the question now is
4:11
like okay how do we really use this in
4:13
your algo right so the way I'm currently
4:15
using it is there is a small function
4:17
which takes in the symbol that I want
4:19
and then the price point at which I'm
4:20
trying to uh you know enter the trade
4:22
into and then the the the function
4:25
basically checks if it's very close if
4:26
it's a long trade it will basically
4:27
obviously look for all the resistance
4:28
levels if it is a short trade it to look
4:30
for all the support levels and then if
4:32
my price the entry price or requested
4:34
price is very close to uh any of the
4:36
levels and then it basically returns
4:38
back either a true or a false confirming
4:39
whether I should go ahead with a trade
4:41
or not based on that the python is
4:42
already coded in such a way that it
4:44
tries to avoid such trades uh and
4:46
thereby you know you you avoid some some
4:48
bad entries in case you want me to uh
4:51
you know provide that code as well uh
4:52
the code that I just talked about uh
4:54
please do mention that in the comment um
4:56
if there's enough interest for it I'll
4:57
create another video where I'll also
4:58
provide you the entire code uh which can
5:01
do all of that the spot checking uh and
5:03
then you can you can just take that and
5:04
plug it into your respective alos if you
5:07
genuinely found this video useful please
5:08
consider subscribing and liking the
5:10
video and I will see you soon in another
5:11
video and until then take care and happy