TradingView Pine Script Tutorial 24 – Using Chart Replay to Avoid Early Entry Issues With Repainting

TradingView Pine Script Tutorial 24 – Using Chart Replay to Avoid Early Entry Issues With Repainting

YouTube Video

YouTube Video Transcript

[Music] hey this is David for big bits in this video we’re gonna take a look at the replay feature on trading view which is gonna be really handy especially when you’re working with certain indicators or strategies one of the big things you’ll need to understand about many of the strategies that are available on trading view is that they are based on indicators that repaint and that essentially means that the indicator starts with one value and actually changes so for example you can see this green line here it doesn’t appear that bad for an entry at the end of it it’s just trying to catch the divergence this is a pretty popular indicator with some parameters I’ve changed a bit but you’ll notice it’s trying to catch a bullish divergence and it kind of does but what you’ll need to be careful for with your own indicators and your own strategies is finding the correct entry and a lot of that has to do with when the candles update does your indicator update where its entry is because if it does then you’re probably going to enter too soon so for example I believe it’s going to first paint this green line at this candle but we can watch on the replay as it continues to push it down as the price continues to drop it might even print it before then so let’s go ahead and take a look all you do is click the replay button at the top of the screen you can actually choose a point on the chart you can use the scrolling feature on the chart to go further back in time if you’d like we’re just gonna start right here pretty close to it we’ve got our speed set to the fastest there is so it’s gonna move pretty quick so let’s just watch all right let’s hit play okay you can see the divergence was built it got pushed down and down and down again so this can be an issue when you’re trying to create a strategy on trading view and you want your entry to be closer to this point but you first get the signal back here at this point so I’m going to close this the replay will run until all of the data is out so let’s go back here to this particular point all right so you want your entry closest to where your final signal is thrown here but the issue is your trading with your first signal here and this is something that’s pretty common now you’re gonna have to adjust for with your conditions and I can’t tell you how to do that but you’re going to have to find a way to try and capture a better point than the first divergence that it showed here or whatever you have in your strategy if it keeps repainting or re updating whatever the line is then you need to find a point in that life of the indicator when it’s showing you that it should be a buy signal when you actually want to buy because like I said if you set it to where it’s going to trigger a buy here whenever you see the Green Line its first gonna buy back here which obviously is not very good you can see the price drops so it’s pretty significantly compared to the time frame you’re working with here so what we’re gonna do actually is I’m going to show you an indicator and what I’m actually going to do is we’re going to be hiding some of the labels which is essentially what this is this is a line object but we’re going to be using labels and I’m gonna hide some of them but alternatively what you could do is use the same method that we used to hide it to make sure that on the third or fourth one that you would be sending your buy signal you know so if it first painted here and you wanted to wait so many candles after that to buy you could do that or if you want to wait it you want to wait a particular amount of buy signals later you could do that as well so I’m going to go ahead and close this I’m going to show you this RS I call that syndicator this was something that one of the YouTube viewers had mentioned they would like to see it essentially allows you to set and oversold in an overbought range and when the RSI value goes below or above those numbers it’ll just print a nice label on the screen for you showing you when the red ones it’s over BOTS and the green ones it’s oversold so it’s pretty handy so you can see where that’s actually occurring on a chart but what happens a lot of the time is you’ll see one after the other because the RSI value stay above the threshold you’re working with you notice we’ve got two pretty close together here but there’s probably several more here so let’s go into the source code here and I’ll show you what I’m talking about that was from a different indicator so we can forget about that for right now okay so all we’re doing here is we’re just getting our RSI value and comparing it to our oversold and overbought levels if you’ve seen all the videos we’ve done so far this should be very simple stuff we’ve covered pretty much everything you’ve seen here and the one thing you will notice is we are creating a label within this if statement and we are printing it and this is if it is oversold so this would be the Green call-outs here the labels now what we’re going to do is we are going to check to see if the previous candle also was oversold which means we don’t want to show two in a row I mean that’s kind of silly it’s just gonna fill up our screen time and time again so we’re just going to delete the one from the last one if it was oversold and we’re oversold now okay the same thing goes for the second and third candle back you could also use a loop for this and make this an input so you can have an input and you can just toggle up and down how many labels back you want to delete if you wanted to now the issue with this is similar to that divergence issue we had earlier where the line would continue to repaint we’re are continuing we are continually deleting those labels that are showing up so that we can try and get a better sense of what’s actually going on and you see it looks like they call the top really well but in reality it might have started back here and I know those candles are pretty small now so let me do that so it could have went oversold here even here our overbought excuse me and then it would have shown a call out and it would have done it again and again and again but we’re just telling it to delete those so if you’re going to short it would have tried to short here instead of waiting further and this is just an idea that you can use in your actual strategies that is to wait further in and that’s why on the RSI bullish divergence strategy that we created in some of the last videos we told it to wait for a smooth average to have a trend of a certain length so if you need to see that as a way to try and capture how many of these you’ve had then that’s great in the next video I’m probably going to be doing another RSI call out but this one will focus on multiple resolutions so for example we would only want to see RSI numbers that are above the overbought number but the overbought number on the hourly chart and it’s also overbought on the hourly chart so that you can maybe get closer to a top on the larger trends so it’s kind of an interesting concept you can require these other numbers be oversold so if you’re looking at these one-minute candles here you get the RSI oversold here but what you really want is you want the the oversold number up here and one of the reasons it might have not worked here is because it was so early in this trend change that it just wasn’t oversold enough on the higher time frames to possibly trigger other people to want to sell at that same value so what what we’re gonna do in the next video is we’re gonna look at what we’re gonna start with the one-minute candles like this most likely and then I’m gonna also require that the five-minute candle is also oversold as well a lot of times the one-minute candle of course moves a lot quicker so it can go oversold bought a lot quicker than the other resolutions so we’re gonna wait until a larger time frame also goes overbought or oversold and then we’re gonna look within on the one-minute here and we’re gonna find the oversold or overbought and make our call-outs then and only then when both of those conditions are met and we’re actually gonna be more than two and this is gonna also be something I’m going to release so if you’ve watched all this video and you like the RSI call out look forward to that particular indicator coming out as well soon in order to do that please be following my trading view account you can see when scripts come out I’ve got them sorted by popular right now but the newest ones I believe if you’re following you get a notification that I had created something I believe it shows up here on the I know that’s the ideas but perhaps a notification but please be following me on here that way you have a better chance of actually seeing when it comes out because it usually takes me a little while to get around to doing the videos and releasing those I may also post on Twitter or discord about these new strategies or indicators that I’m publishing but probably the quickest way is obviously to check trading view because when I published them they’re available immediately let’s say I don’t believe there’s anything else I need to cover we’ve talked about the replay feature which is really quite awesome and we’ve also talked about these labels and I do want to go back and point out that we called the label dot delete and when you create a label it actually kind of acts as a series of labels they’re just kind of interesting to me how the pond script actually works and handles this pond script is a pretty unique language for me I mean it’s very similar in a lot of ways to other languages there’s most of them are but some of the some of the ways that handles things are a bit odd but you realize that they kind of have to do these things so that people can’t really take advantage of how they render these scripts but that will do it for today if you liked the video please leave a like of course follow me on tradingview if you like these types of videos please subscribe I’ve got twenty-something videos before this one in this particular series alone I’ve got other series I keep up-to-date on crypto projects and do some ta every once in a while and some live streams as well so please subscribe to the channel if you haven’t done so already we also do giveaways but that’ll pretty much do it all for today if you’re looking for your own trading view account and you’re going to decide to switch to a paid account please consider using the referral lengths the referral link in the description of the video that will get you $30 towards an upgraded plan it’ll also give me $30 and they’re quite expensive so if you use the referral kind of help us both out and really that’s that’s about it for today I know I’ve said that before but I mean at this time so thanks and have a nice day [Music]

YouTube Video Description

< br/> #bitcoin #crypto #cryptocurrencies #tradingview

Website: https://bigbits.io
Discord: https://discord.gg/rapMn4z
Twitter: https://twitter.com/BigBitsIO
Facebook: https://www.facebook.com/BigBitsIO/
GitHub: https://github.com/BigBitsIO
TradingView: https://www.tradingview.com/u/BigBitsIO

Referrals……
Trade on Coinbase: https://www.coinbase.com/join/johnso_dxz
TradingView: https://www.tradingview.com/gopro/?share_your_love=BigBitsIO
Brave Browser: https://brave.com/big406
LightNite Game: https://lightnite.io/ref=BigBits
VIEW ALL HERE: https://bigbits.io/bigbits-referrals/

DISCLAIMER: All my videos are for educational and entertainment purposes only. Nothing in this or any of my videos should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto coins and tokens. Consult with a professional financial advisor before making any financial decisions. Investing in general and particularly with crypto trading especially is risky and has the potential for one to lose most or all of the initial investment. In simple terms, you are responsible for your actions when trading.