Skip to playerSkip to main content
  • 13 hours ago
Transcript
00:00Let me give you a scenario and see if this is familiar to you.
00:02Your algo strategy has identified a trade opportunity.
00:05All the rules of the strategy were fully satisfied and the algo now confidently goes ahead and places the buy order.
00:10Within a few seconds, the price reverses and your asset is hit.
00:12Sounds familiar, right?
00:13Well, this is the story of...
00:15In this video, I will explain one of the most common reasons why this is happening.
00:20We'll also talk about the trading use best support and resistance indicator and how it can help the situation.
00:25I will walk you through its python version that I built.
00:27I will also explain how you could use this python utility for free.
00:30In your own algo and say goodbye to bad trade entries.
00:32So, let's get started.
00:35If this is your first time here, welcome.
00:36My name is Vivek and I am a financially independent algo trader.
00:39This channel is not the only thing I would like to share with you.
00:40It's all about building a community of algo traders.
00:41We discuss everything about algo trading using python, building and backlisting trading.
00:45strategies, market updates and much more.
00:47Please do visit our community website fabtrader.in.
00:50Also, do check out my other YouTube channel, Fab Wealth, where I talk about my own financial
00:53independence journey and share tools.
00:55methods and strategies that help me achieve my financial freedom.
01:00During my initial days of algo trading, I used to run into that scenario very often.
01:05I used to think I have the perfect strategy.
01:06I've backtested it multiple times.
01:07My confidence was high.
01:09And yet when the first...
01:10order went out within a few seconds, the price reversed and my asset was hit, right?
01:13It was a bit frustrating.
01:15Because the wind ratio was nowhere closer to what it looked like when I was backtesting it.
01:20I know there's nothing wrong with the strategy.
01:22There's nothing wrong with the timing of the trade as well.
01:25But what I did find out is that the problem was with the price point at which the order went out.
01:30Most often what happens is the buy order is placed very close to an existing resistance line.
01:35So when the price starts moving, it hits that resistance.
01:38And then even if it is temporary...
01:40If you were literally pulling back, your SL would hit and then the price would start continuing in that direction that you want.
01:45Similarly, in case of a SL order, if you place it very close to a support, you would...
01:50you would end up with the same situation where the SL being hit.
01:53When I was looking for a solution...
01:55to this, I came across this particular wonderful trading view indicator called the Supporter Assistance Dynamic by the...
02:00Lonesome Blue.
02:01I'm sure you are aware of this indicator.
02:02It's one of the most popular indicators on TradingView.
02:05and one of the most simplest and the accurate indicators that you can come across.
02:09The way this indicator...
02:10works is very simple.
02:11All it does is basically looks at all the turning points of the prices.
02:15and then generates these various pivots.
02:17And then it also generates channels.
02:18Equal size channels.
02:20And then more pivots within that channel indicates that there is a lot of...
02:23there's high chances of price.
02:25basically turning back.
02:25Because in the history, that particular zone acted as either a Supporter or...
02:30resistance.
02:30And based on that, this indicator draws these SR lines.
02:34And when I...
02:35paper tested it, it worked wonderfully well.
02:37But now the only problem is...
02:38this is in Pinescript and this is on TradingView.
02:40But my Algo platform is based on Python.
02:42So there was no way I could use this indicator directly.
02:45there.
02:45And that's when I had to basically sit down and rewrite the Spinescript into Python.
02:50And this is the Python code for that indicator.
02:53It simply requires NumPy and pandas...
02:55as dependencies to be installed.
02:57And the way it works is pretty simple.
02:58You give it a symbol.
03:00And then you say what time frame you need this on.
03:03Right now I've given a daily candle.
03:05And then you can even go as low as five minutes.
03:07And then it'll still work.
03:09And then once you run it.
03:10It'll provide you the support and resistance levels.
03:13As seen on the...
03:15Indicator.
03:16This code is available for you to freely download this from our community website.
03:19I'll provide...
03:20the link as usual in the description.
03:22The only change you might have to do is...
03:23currently I'm using Xeroda to get his...
03:25your data.
03:26So depending upon which broker you're currently using, you know, you may want...
03:30to change the code a little bit to get the historical data.
03:32So this particular line is what you might have to change this.
03:35This function is you'll have to replace it with your own function to get the data.
03:39Apart from that, the code...
03:40the code works just fine.
03:41Now that the code is run, let's try and compare what we got here and see if this is...
03:45accurate with what we see on TradingView.
03:48Well, on TradingView, we have these five...
03:50levels and this is exactly what the Python also provided us.
03:53So we know that the exact number...
03:55is match.
03:55So we know that the code really works.
03:57So now that you have the code, you can run it on your own for...
04:00various instruments and then please do give me some feedback on how this is working.
04:05Well, now that we know that the indicator is there, the Python version works and all that...
04:10the question now is like, okay, how do we really use this in your algorithm, right?
04:14So the way...
04:15I'm currently using it is there is a small function which takes in the symbol that I want and then...
04:20the price point at which I'm trying to, you know, enter the trade into and then the...
04:25function basically checks if it's very close.
04:26If it's a long trade, it will basically obviously look for all the resistance levels if it is a short...
04:30trade, it will look for all the support levels and then if my price, the entry price or requested price is very...
04:35close to any of the levels and then it basically returns back either a true or a false confirm.
04:40whether I should go ahead with the trade or not.
04:41Based on that, the Python is already coded in such a way that it tries to avoid...
04:45such trades and thereby, you know, you avoid some bad entries.
04:50In case you want me to, you know, provide that code as well, the code that I just talked about, please do...
04:55mention that in the comment.
04:56If there's enough interest for it, I'll create another video where I'll also provide you the entire code.
05:00which can do all of that, the spot checking and then you can just take that...
05:05plug it into your respective values.
05:07If you genuinely found this video useful, please consider subscribing and...
05:10liking the video and I will see you soon in another video and until then, take care and happy trading.
Comments

Recommended