Getting Line Price – Label Styling – Candlestick patterns and More Pine Updates

Getting Line Price – Label Styling – Candlestick patterns and More Pine Updates

YouTube Video

YouTube Video Transcript

[Music] hey this is David for big bits and in this video we’re gonna talk about some of the updates in pine that have been introduced lately as well as one of the tradingview updates as far as indicators are concerned there’s been quite a few updates lately and for those of you watching on YouTube which might let you all know that I am actually posting this as an idea on trading view first so you haven’t already please follow me on trading view so you can get notifications on this stuff sooner because I’ve got to edit the video before I upload it to YouTube so that has the fancy intros and outros and stuff so of course like the video and subscribe there as well but we’re gonna be starting off we’re gonna try these ideas on trading mute first and then uploading them later on to youtube to see how this kind of actually works for big bits but for now we’re gonna go ahead and get started on some of these updates now some of the most important parts will just cover all the updates really quick and then we’ll go back and we’ll talk about how to actually use some of those now there is a new function for lines I get price it allows you to get the price of any particular point on the line and then of course there are new label Styles which allows different directions for your labels basically just allows you to go off at a diagonal now and left and right as opposed to just above and below and there are also tooltips now for labels then one of the big things that I think a lot of people are excited about are the candlestick patterns are available now as a built-in script has its own section and everything so that’s great to see and there’s also some information here on the base currency so if you’re working with a script and you need to know the base currency like if you’re working with Forex or like a crypto trading pair you’ll be able to see the base currency that you’re working with and of course the quote currency would be USD in this example then your base would be you are now they also have added a time zone or ammeter for the time itself okay usually it says in the past that is always returned the exchanges time and now you can actually specify the time zone and this is just an example of the reference it will go back and talk about this but I really want to focus on showing you all how to use line not get price and then also how to use these new labels this one’s a lot easier than lined up get price and I’ll show you an example of how we’re gonna use these together and hopefully everybody can learn a little bit so first thing we’re gonna do I’m going to define basically what type of line I want to create on the chart and then I’m going to try to find the price in the middle event and I’m going to plot this nice little label here that shows where the midpoint price is so to do this first what we’re going to do is we’re going to create a look-back period for the high where we’re gonna go back and we’re going to look for the highest high value in this but in this look-back period so we’re gonna go back up to 25 candles look for the highest high and it’s gonna start the line there then we’re only gonna look back 10 candles for the lowest low will find our lowest low in the most recent 10 candles here you can see a strong it’s line from the highest high to the lowest low with in its respective look-back periods and then it’s calculating where the midpoint is as far as the number of bars back from the current bar and then it is actually printing the label that many bars back at the price of the line there so that you can actually see the label is pointing to that particular spot on the line so I’m gonna walk through the code here I’ve already completed the code and if you’re curious about pine scripts and stuff I have plenty of scripts on that on my profile plenty of videos as well so you can always check out all of those resources but we’re gonna just go over the code kind of line by line just talk about what’s going on and then you can see where we’re actually using some of these new features in just a moment so the first line that isn’t really an input here our look-back period so our inputs we can change those and play around with those in just a little bit but for now first thing you do is be plotting your line and this is just going to plot a line with default values it’s going to create the line at the current bar index from the high at the current bar index to the low it’s gonna be a white line and we don’t really want that we want to actually set our X&Y of the first plot or the first point in the line and we’re going to set our X&Y and the second point of the line as well and to do that we are going to look back for the number of bars back for the highest high and to do that we use highest bars function this gives you the total number of bars back from the current bar that the highest value of the data you specify occurs within that period it’s kind of confusing but it’s all it’s saying is we’re gonna look back 25 candles we’re gonna look for the highest value of all the highs and then we’re gonna say how many bars back that was from the current one that’s all it does and that’s gonna be our x value our y value is gonna be the highest high value there so our X was the number of bars back our Y value is the highest high now we do the same thing for the lowest low with in the look-back period it has its own respective lowest bar function so that’ll tell us how many bars back to plot our x2 and then our y2 is going to be that lowest value within that 10 period look back to the lows so now we have our X and y1 and our x and y 2 so now we can plot our line we have a wonderful line here but what we really need to do now is we need to determine where the middle of this line is so that we can place the label and in order to do this we have to calculate how far back our first set of bars are well just either set really and then we need to add those up and get the average and of course this will have to round because there is no hash bar or a quarter bar it’s gonna have to be rounded essentially to an integer and to do this we use the highest bars function again and ideally if you wanted to minimize code you would actually kind of save this as a variable and reuse it here and here but for now we’re just going to keep it like this because this is a negative number here we are going to calculate the highest bars back plus the lowest bars back and that is actually incorrect my apology so I actually caught a bug on the fly so how about that all right so now we are looking for our lowest bars back and we’re using our low and our low look back so we’re looking back this is what like eight bars back and that’s like 19 or 20 we add those up divide them by two it gives us about you know fifteen or sixteen bars back we’re now at our midpoint line we know where our midpoint is on the line how many bars back that is so now we have to know the Y value so our bars the midpoint bars that we just calculated that is the x value of where we’re gonna place our label we need the Y value which is going to be the line price so in order to get it right on the line we have to know the price that’s gonna occur on this line on that bar and in order to do that we use the new line dot get price function and we specify that we are using our line that we plotted on a chart and then we tell it the bar index is going to be the midpoint bars so we’re getting the price of the line that many bars back which is our midpoint so it’s looking for our price on the line here and now we have our X which is our midpoint bars and our Y which is our line price at the midpoint so we have our x and y for our label now so that is a long way to go showing you how to find the price but it’s also pairing it with the label here you can see it actually uses a nice diagonal style here it is using the label Apple label upper right and that just essentially means from the label the little I don’t know what you want to call it a little pointy part goes up into the right and if you change this at any of those directions you got to keep in mind the direction you’re telling it upper right is the direction it’s going to point so if it said lower left then the label would be up here and it would be pointing down to the lower left so that’s something to keep in mind and that is about it we’ve set our label on here we’ve created the default label and then we plotted it of course at that bar index for the midpoint bars at that price I already said that but I kind of forgot to show you on the code itself where that actually was now that that pretty much handles the two major points that I wanted to show you and just to show you how you can actually do this when you’re working with your code you can actually adjust your values on your look bags here and now to redraw the line and now you have a new midpoint so it’s calculating all this stuff for us let’s go back 150 that didn’t change anything let’s go back wow that’s too much let’s go back 500 that bad it’s way too many bars back let’s just do 110 so it’s the same thing as what we had earlier you can see how it’s kind of recalculating over time there now we’ve gotten those two functions done I did want to talk a little bit more about this and this is on the pine coders Twitter account they post these updates and not all of these are gonna be shown on the trading view updates so if you haven’t followed them on Twitter I recommend it I follow them on Twitter myself just to see these things and I like to stay up to date on what’s going on what’s available and I’d like to make these videos for you all so I’ll follow them personally but if you want to see these updates and know what you’re capable of doing as well then I highly recommend you follow them as well but you can see there’s a tooltip now for your labels so now you don’t have to take up a ton of screen space to show all this information if you just want to use a label to highlight here that this H has occurred then you can also give more detail using the tooltip about what that is now this is a pretty long tooltip in my opinion but in the use case here it makes a lot of sense the other thing and this one is really awesome the candlestick patterns I’ll actually go ahead and show you this we can minimize that code now and I can actually show you when you go to pull up indicators click on candlestick patterns and it gives you all these built in candlestick patterns or my favorite ones to look for our doji’s so I’ll add that to the chart you see there’s a doji here it uses that wonderful tooltip feature to give you a bunch of information about what a doji is and now it also shows you where it is on the chart so you can see there’s two doses in a row there one there one there so it’s actually really nice let’s also add in a bullish engulfing because I want to see when we have bullish engulfing candles so there’s a bullish engulfing candle there’s one there’s one there’s one so it makes it really easy to spot when there are these different candlestick patterns and the great thing about these so you can actually look at the source code and you can see how it’s actually done so you can figure out if you want to use this in your own scripts how you can do that as well now going on beyond that we’ve talked about the base currency this one’s super simple and then we also talked about the time zones for the return time based on the exchanges but really the main thing you need to know is when there are updates like this they often link to the reference manual the pine script reference and I usually just google pine scrip reference manual and I also have it bookmarked but you can go here and you can get information on the new stuff as they add it into the documentation like line get price that function is already in here shows you how to actually do it with a nice little example as well so if you wanted to see how to do this stuff check out the pine script reference manual and if you want to keep up to date of course follow up on coders on Twitter that’s what I do and they keep me pretty up-to-date on what’s going on as far as new additions to pond but that will do it for this video I hope those of you on tradingview who are watching me for the first time I’ve enjoyed it and can follow me on trading view check out some of the scripts I’ve done that I’ve already done to help people learn about using pine script I’ve done quite a few tutorials and for those of you who are watching this on YouTube later after the training view video has been posted I would appreciate it if you could like the video as well and also while you’re down there liking the video please subscribe as well I really appreciate that but I believe that will be it for this particular video I really appreciate all of you watching have a great day [Music]

YouTube Video Description

< br/> ???? IMPORTANT LINKS BELOW ????

Getting Line Price – Label Styling – Candlestick patterns and More Pine Updates: In this TradingView Pine Script Tutorial/TradingView Update we discuss how to use the new function line.get_price to get the price of a line at any point by specifying the bars back from the current candle to the line we are referencing. By getting the line price we can use that to plot a label at the line’s mid point by getting the price at the calculated mid point of the line. We also discuss other updates such as brand new built-in candlestick patterns on TradingView! With Pine Script it is very easy for even beginners to create their own indicators or strategies that have many other indicators within them. Once we have completed the script, we can see our results immediately and begin working with more functions, indicators, and strategies.

??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️
Social and other public profiles
??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️??‍♂️
? 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

???????????
Referral links
???????????
? Buy, Sell and Trade Crypto on Binance.US with LOW fees: https://www.binance.us/?ref=35105151
?‍♂️ Want to buy crypto? Get $10 of bitcoin w/ your first purchase over $100: https://www.coinbase.com/join/johnso_dxz
? Sign up for a paid plan at TradingView and receive a $30 credit: https://www.tradingview.com/gopro/?share_your_love=BigBitsIO
? Browse privately and get rewarded with Brave Browser: https://brave.com/big406
? Receive bonus perks when purchasing 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.
❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️❗️

#bitcoin #crypto #cryptocurrencies #tradingview #binance #binanceUS #coinbase

This channel focuses on Bitcoin, Ethereum, LiteCoin, Ripple, Link, Basic Attention Token and almost all cryptocurrencies that demand attention. Please like the video if you liked the video, and subscribe if you like these types of videos. David from BigBits is an experienced Software Engineer, but no one is perfect, If you find any issues with any of the open-source, free code, or code shown in videos please comment to let us know what to fix, we listen to our viewers!