Bitcoin Trading – Indicator Development – Live Stream 9-30-2019

Bitcoin Trading – Indicator Development – Live Stream 9-30-2019

YouTube Video

YouTube Video Transcript

you Oh you getting ready to start your guess settin up a few things you fully aware that I can be heard right now and start the intro I stated four big bits I just want to do a quick stream while I have some time here it’s gonna do some development on the scripting tutorial stuff I figured I do some of this live that way case anyone’s watching actually wants to comment or ask a question you’re certainly free to do that I’m gonna try and keep it on the chat but there’s a few things I don’t want her to do I’ve already started working on this 7th tutorial and I’ll go into a lot more detail later but essentially it’s just allowing us to select different resolutions for our moving averages that we’re working with here so really all I’m gonna work on is just adding a few more moving average types to this indicator and just kind of test those out right now start with the volume weighted moving average you so the price today has actually been pretty good I don’t know if anyone’s noticed but it spiked up quite a bit earlier today and it looks like it’s meeting a little bit of resistance but I mean there was an awful lot of volume in a single minute candle here the price jumped up quite a bit which is good sign save this real quick is that should complete the volume weighted moving average got this coded it’s so simple to add just another moving average here let’s switch out to the weekly I mentioned this in the last room last night but it looks like it found a little bit of support there on the 100 week moving average zoom in even more and more here yeah that’s the 100 week moving average go back to the 1 and chart I can actually change the red one to where it’s showing you the 100 week yeah so the red line was the 100 week and you’ll see it above that it went below it but it wikked and closed above every single time all right I’d also give you a kind of an idea what we’re working here with on the indicator we’re doing the multiple resolutions you excellent let’s add another moving average here smooth average SMA zwei you let’s go ahead and enter option any you remember in our logical branches whatever value is last here this was going to be spit back out of the function so it’s completely fine we don’t have to set it equal to anything it’ll automatically take care of that for us because of how we’ve coded the rest of the indicator you you pressing a lot of these indicators that I’m looking at that have these other moving averages have horrible documentation and the code is not very friendly to look at people who have done this or not typically programmers which I would expect you it’s really weird getting some conflicting calculations on this one you does a weighted moving average and then it okay obviously what it’s not here it’s just doing a weighted moving average she doesn’t make a lot of sense you I’m not even gonna add that one like that to the I was thinking about doing LS ma or Alma but I don’t want to have to add in new butts you I really don’t want to have to add in new inputs we’ll just take that one out for it just leave it out was but just add in that I mean weighted moving average it’s not pretty simple stuff it looks like it might be getting ready to break out on price right now that’s good and I’ll just save this for now I don’t really care to add these other ones in this particular script and I’m not entirely sure this script is ready to to add those to it anyway but it’s really good having all of these different selections available for you yeah I’m just seeing that message Magnus we’re gonna get to where we can do the strats so if you follow along in the scripting tutorial series I’m doing we’ll get to where we can eventually do our own strategies and stuff I’m actually kind of learning some tradingview stuff as we go along here I’ve done trading view coding before mostly just really simple indicators but I wanted to make some more advanced stuff now because I’ve developed my own trading BOTS before and really a lot of the stuff I see on trading view is pretty simple and you can do a lot with it and trading view is actually missing a whole lot of stuff in it spine script language that could help it I’ve tried a few things outside of the tutorials here and it’s missing a few things that I think would be really beneficial and I’ll probably touch on those in a video you know specifically for it let’s actually just make a new one what I want to do is just actually just make a copy of this one save as they’re real well of course but what I want to do is I want to have this series go from being just the simple moving average you’ve seen in the first video to something very very complicated with a strategy with several indicators that’s very flexible like the one we’re looking at now where we can change a bunch of settings and stuff okay so this is an indicator that I have made before see it didn’t load this source for that one rs has smooth we’re gonna have to go in and change this one let’s take out everything except for the period actually sleeve everything for ma one and we can always change it for ma too if we need to we don’t know I’ll leave the forecast stuff just in case there’s a need for us to forecast an RSI I’ll leave the MA function okay so we need to do an MA resolution leave that and May one and get rid of that stuff for now definitely don’t need that that was just for testing these are crossovers don’t really care to plot the crossovers on an RSI draw the information chart it’s just plotting it that was just setting the value okay this is for the bias doing and let’s just kiddin a bit of all that I don’t want this code to actually execute you well okay you so it’s not going to do any bias or forecasting now which is good don’t want this to be overlaid on top of the chart so we’ll turn that off let’s change this to our side smooth and change this to our side smooth as well so what I’m really wanting to do here is I’m wanting to create just a regular RSI chart and with the RSI I want to also create a second line which is a smoothing line for it and you can actually see this and other indicators oh that’s no good well essentially this stochastic RSI and the MACD both have smooth lines the blue line is your MACD line here but your orange line is a smooth line but they call it the signal on the MACD and it’s just the blue line being smoothed out and what I want to do is I want to do that with our RSI because a lot of times with RSI when you get in bold diversions it’s easy to see on the chart but it’s hard to predict now if you have a smooth dar si like let’s say for example here you went oversold here you know your smooth dar si could still be to where it isn’t over salt but if the price continues to stay low and it goes oversold again your smooth RSI would continue to drop because it has been it has its own moving average and when your smooth RSI starts to turn up then it can actually kind of help indicate extended periods of selling so you can find a good spot to turn around now of course everything is not guaranteed but that’s just what we have here let’s actually I want to change my loadout or my load on my chart here go to something new save that you you creating this strain elements it’s open our indicator that we are working on now our RSI smooth that’s not really doing anything so well what it is doing is its plotting the price or a moving average here but it’s not plotted on the chart because we the overlay turned off all right thank – I have missed your other messages but keep in touch follow me on social media and you can message with me whenever ma’am all right so gonna continue here working with the RSI do make sure I get this calculation I’m just going to borrow this one from another script you okay there’s a built-in function for RSI even better so now to actually make versa you let’s make this an oscillator function OSE type which is gonna be RSI for this one and this is great because we’re creating code we can reuse again when we make functions OSC source OSC period and this is going to be for oscillators specifically give me just a moment here got a message I need to follow up on you all right so let’s to have in if OSC type is equal to RS I and tabbing again we’re gonna spit out our value which is going to be an RSI based on the source and the period pretty simple actually very very simple now that we have that let’s change what we’re plotting here now we’re actually going to take the resolution of the MA one that’s still fine and but we’re actually going to do an oscillator here in May one type source and period that should take care of it by just switching the function to use the oscillator function and use the RSI that should do it so now it should print the RSI and but the RSI value oh man the default value is way off here let’s change that we don’t need this stuff either I forgot to uncomment this out or to comment that out i source resolution visible yeah that’s all fine it’s good i need to set this to a default of 14 i believe is the RSI can knock about a forecast bias magnitude okay so we also need to comment out this function or now because one of the variables it was using was defined at a higher level she’s not being used anymore so let’s say this even will actually compile now she believed it should a oh boy am I even plotting here yeah so something’s off so we’re using yeah they may want type defaults to SMA so of course it’s not going to work there is no condition for it so let’s actually change this since we’re not using moving averages let’s just change this to where the only option is RSI and we’re going to set the default value to RSI and hopefully that should take care of the issue that we’re having yeah there we go okay so let’s actually compare this to the actual RSI that’s built in here look at that the values in the green and the orange here should stay exactly the same and you’ll notice they are throughout time they are always the same and that means RSI calculations correct now we also want to do a smooth version of this so we’ll want a second value here should have not deleted all of those wonderful options for my moving averages and this will be a will start with us fairly quick smoothing we’ll just have it in half and change all these twos excellent that’s completely fine now when we set our second ma the first one is the RS I will have to come back and rename these things later but our second one is actually going to be an MA again and we’re going to have to pass in the appropriate types and resolutions and then we’ll also have course have to plot it as well you make sure I don’t forget anything when you’re copying and pasting code like this it’s very important to make sure you catch everything because unless there’s a good search and fine tool built-in then it’s sometimes pretty hard to find your mistakes when you forget to make a certain change when you copy and paste code like that see let me save this all right now let’s open up our other ones so we can copy those options from it you you No go back up to our options switch to the default copy that okay I don’t want to even see this let’s go to our RSI smooth go back to our source here and plug in our options for our moving averages all right great now we’ve got all of our different moving averages that we can use the default is going to be a simple moving average the smoothing period is going to be seven but our source that actually needs to be in May one so we might have to play around with the code quite a bit to get this to work because the sources it’s expecting are based on the built in list of sources so you might have to play around to get system to work correctly you yeah give me the Simone you you so I really want to continue using the moving average function if this source is based on that just want to make sure that we can do this well the built-ins just return a value so let’s just try to toss in ma one is the source here see how that works out you I think that worked okay yeah the source list is a just like a predefined enumeration land of c-sharp where I come from but there was also the chance that those were the only options that the built-in moving average functions expected but since it was more like an enumeration than we were able to pass in any sort of decimal value here so you can see now when this line gets smoothed out that definitely see where these kind of divergences build up and you don’t even have to actually plot you don’t have to draw the lines on the chart you can actually see where these have slowed down now let’s actually change this it’s just our settings either let’s change from simple moving average – a whole moving average go you say that follows really closely so that one’s probably not great let’s slow down our RSI to 21 and let’s change this back to a simple moving average excellent so we still need to add some lines for our oversold and overbought areas and we actually need to change the color here the lines let’s go ahead and do that now because that’s really bothering me change this line it’s the one you excellent that’s that’s much nicer okay very good this is a 1-minute chart so this one probably doesn’t show you the way I like to look at these RSI smooth values because things usually happen a lot slower on one day candles let’s take a look and we’ll have to kind of look down here as well you can see if there’s a divergence built up here doesn’t really matter because we’re looking at the smooth line and you can see when the RSI crossed back over above this one there was a good chance for it to pop back up it did RSI smooth value stays down there now uh there’s a good chance we want to offset this and I actually want to kind of find a way to wait these a little bit better because I think the past values we waited a little bit better with the current values because what I want is I want this dip to show up right in through here that way when it’s leaving the oversold conditions it’ll show up as the line coming back up so let’s we can just play around with different moving averages to try that out let’s try a weighted moving average that definitely doesn’t do it we could also try slowing it down quite a bit on the simple moving average you now what I’m trying to create is the RSI showing up is oversold on our smooth line and coming back up sometimes when you’re working on building these indicators you have to find out you know you have to test this different moving averages you have to test these different sources and I need to get rid of this input here because we’re actually using the MA one for the source let’s actually you and you can also play around with that here on that since that’s for the RSI you NARAS is so quick it’s really hard to work with but we have got some code here and if you’ve been following along in the video you there’s some really great stuff to look at here and to learn from as far as how to work with other things and also how to use these functions because we did create a new function just for our oscillator here you well we’ve gotten our snood RSI that’s probably good enough for now let’s take a moment to find well let’s take a moment to look for the code we need to plot these lines and fill in between and this has been a while since I’ve done it so I’m going to look that up shortly here you a you go to the reference manual here and that’s what I thought it was Thanks okay let’s go to where we were plotting and let’s plot some lines here so now we are going to do a horizontal line I cannot type right now and we are going to have the value be at 84 oversold or overbought excuse me the title we’re gonna have as but let’s do color white we’ll try to make it look somewhat like the built-in RSI and we’ll do a line style that does not work they must have changed that too recently I bet you there is a line style dot it’s not nice – something wrong here just go with this for now it’s not changing the color on there which usually indicates that we’ve done it correctly so we’ll see and linewidth also that equal to one alright so let’s try this out and see if it’ll bought our upper line no it was not dotted of course that is not a valid option anymore this is probably something to do with us using version 4 and the documentation that they have available may not be updated for that so let’s just take that out we don’t necessarily need a dotted line honestly by default I think it’ll probably do just so great even though it did they dashed or dotted line by default that’s good it’s actually what we want so let’s go and let’s do our oversold line set that down at 20 let’s capitalize this stuff so you look at that now and then now we’re going to do a fill between the lines and you’ll get a really good idea where things were you you I have to set these equal to the variable here so this would be over BOTS and we’ll call this one oversold so now we’re going to have to fill between the two of those and I’ll put the lower value first you can see that they got filled between I would imagine we could change the fill color by default let’s look at that and their documentation yeah that’s the third option and then let’s actually I want to fill a couple of other things so that Phil can be let’s call that orange watch this so we’re gonna show it that we want to buy when things are oversold potentially so let’s do and oversold here and let’s make this one green because this is potentially where we would want to buy and then let’s do another one from 100 to the overbought and let’s make that one red because that’s potentially when we would want to sell doesn’t like the colors h-line h-line oh but the documentation says that should work okay it might not like that we put in those numbers specifically you it’s actually plot a line on those max and I really don’t want these to be showing up on the chart but we’ll do it anyway you see if aligned with the zero will work and let’s comment these out so that we can test that build to see what that max line is going to look like yeah looks like it’s actually gonna show up there even though it’s got a line with the zero so that’s kind of unfortunate way to set the visibility on these things let’s take a look you it doesn’t appear to be available in the documentation so we’ll just continue on to having that line that there is completely fine we’ll just know that that is the actual max a big deal let’s actually color them in red for this one mean let’s do those orange so it’ll match our kind of color pattern we’re working with here and then we can remove our comments so that we can do this and we’ll just change this to min and this to max and let’s sit this one two men that’s gonna be a zero title is min color green line with zero let’s check this out see if this turns out all right so I’m going to close our original RSI so we can take a better look at this one and I’m gonna move it over so we can get really good look alright so you’re getting kind of an idea here with this smooth RSI which is our yellow line that when it leaves the orange area and it enters the oversold area but that might be a good opportunity based on RSI strategies that are out there that it might be a good time to sell and what you’re really trying to avoid are the the times when the RSI goes oversold here so let’s look at the price here if if we just sold when RS I went over sold on our indicator then price would have continued to went up and we would have been out of profit on a short so if you would have waited until the smooth RSI was oversold you would have had a better entry on a short here and let’s go back and look at likewise here you get a really good idea here of why it’s pretty important now this was kind of out of the ordinary with the extended amount of time oversold you can see when it came back up normally that probably would have indicated a good time to buy and of course it always isn’t but you’ll see that RSI continued to stay low that’s because the red candles continued continued on and price continued to lower so it’s always something you can change and keep your eye on I think this area was definitely a unique moment in Bitcoin history with the way with respects to RSI and you can even see here when RSI peaked out there that wasn’t even the best time to sell if you kept an eye on your smooth RSI and you sold when it was further along or you waited for a divergence there you would have had a better chance to sell at the peak let’s the all-time highs so there’s obviously a lot of work here that we can do to improve this clearly because entering a bull market it’s going to be hard your RSI is going to go over here yeah it’s really hard we might even want to slow it down even more let’s just take a look and let’s slow it down a lot so this is a 14 period ear it’s gonna take a lot to get your RSI oversold on a 14 period smoothing it really is and let’s see where was that at up here yeah that was about right slow down even more and since this is a smoothing it doesn’t have to be the same as it doesn’t have to be equal to or less than the actual RSI source it can be slower let’s take a look at 17 here it it looks like a time that one pretty well okay so it only went over sold on the smoothing once and it was right back down to the neutral territory that would have been a perfect opportunity with these settings here maybe not so much RS I barely got oversold and here kind of had to wait for it to leave to get an opportunity but you know you’re saying this is a bear market so it’s hard to say and then again at the peak you might have had a better chance to get a really good short in there you know there’s not a lot of great times to buy when the RSI is low because historically it just doesn’t get that low continue to go back we have not had the smooth moving average into the oversold territory yet so let’s change it to be LX and take a look at how this is work there oh yeah look at this it did it right here it would have told you to buy here so definitely not always the best indicator but what you can do and what I typically do with my trading is if I wait and my indicators are telling me it’s a good good spot to buy and the price continues to go down then it’s likely creating a divergence and it’s going to bounce later so what I should do is I should just average in that’s why when I usually buy into something I usually don’t buy in a lot and now this isn’t trading advice I’m not trying to tell you what to do but that’s what I like to do is I actually like to start with a normal satisfy for me but I usually plan to average in and if I were to average in as I knew this would most likely form a divergence here because we were already incredibly oversold it would have been a great time to catch this little rise here so some people at all right now let’s go back on BLX Tartans trying to find something that’s actually oversold here oh wow yeah I the one stretch of being oversold here in our recent bear market was absolutely unheard of being that low for that long especially so averaging in down through here wasn’t a bad idea it just wasn’t historically that had never really happened like that before yeah so going back through bitcoins history really doesn’t hit over here but having this smooth the RSI can help over here let’s take a look at some like stocks or something and see how it would compare over there look at Apple look at their daily chart oh my goodness and it almost got up there ya ain’t base they’ve done really great they don’t get oversold too much either maybe they don’t play stocks I just wanted to see how it would look over there I guess this is probably because there’s not nearly as much volatility okay here you go back in April 2012 looks like we were oversold for an extended time on the RSI and if you averaged into a cell when it was over he would have ended up in some profit eventually but this is just one of many indicators you definitely shouldn’t just use one indicator to determine what you’re gonna sell but I like looking at this smooth line to give me an idea of when something’s been oversold for an extended period of time and it’s a good example to show you all how to plot and use your different colors and all these other things so I am going to actually publish this one very soon let’s go back I think I’m gonna finish the video by preparing it to be published so let’s go back to Bitcoin let’s go back to the 5-minute chart here well it’s continuing to do very nice you can see it’s just now hitting oversold on the regular RSI okay you actually set these to the default values it’s 14 and 17 SMA change this to the RSI so we’re going to leave the code to say ma one I believe you yes we’re gonna leave that to say that and ma 2 is just gonna be renamed is smooth is moved you excellence should be good the title of our plots here say that you also need to turn off a few of our settings we don’t need resolution input we don’t need the input okay so we’re going to do is we’re going to copy this line and then we’re just gonna set it manually and it doesn’t need to be an input you our source doesn’t need to exist because we’re using the MA one which is the RSI and our resolution current we shouldn’t have a resolution for this one because it should use the same resolution as the RSI whether or not it’s visible that’s completely fine to stay the type yes that’s completely fine as well okay so we’ve made some more improvements here in May to resolution where is it looking for this yeah we don’t need this at all the security related stuff that is just for the different resolutions and we don’t need that at all not on the smooth see now if we say we’re looking at the 5-minute chart here change this to where we’re looking at the one day all right so the reason it looks like this and the reason it looks flat it’s because we’re on a 1-day chart the changes don’t happen very quick over the course of a day when you’re looking at a 5-minute chart let’s zoom out and now you can get it kind of an idea that it changes every day the RSI based on that resolution so if you’re trading like during the middle of the day and you see that the daily is already oversold maybe it’s a good opportunity to buy some dips during the day because there’s probably going to be a lot of volatility if it’s already oversold just some thoughts changes back to the current resolution and you’ll of course have to play around with these values and see what’s relevant but you know like this indicator it’s pretty neat it’s not super useful yet from what I can tell but I mean looks like we’re getting oversold here if it were to peak up really high and you’ll get this a lot a Bitcoin usually doesn’t go super oversold or overbought but let’s take a look at something else like a low cap coin check out nano I like to pick on NATO sometimes let’s see he really don’t have a lot and maybe this is something that’s better on a one-minute chart no nay-no goes missus Saturdays not enough volume let’s look at Ripple and now if this one doesn’t have it I’d be shocked yeah okay you can see they go over BOTS overbought overbought oversold so what happens quite a bit there on the 1-minute chart let’s take a look at the 5-minute yeah yeah they get overbought on five minutes as well let’s see we’re on the five minute chart let’s switch back to the one minute and let’s change our RSI to use the five minute chart you can see we were looking at the five-minute chart we were oversold here and if you’re looking and using other indicators and you’re looking at this different time frame this higher-level time frame you might have been able to get a quick scalp in using other indicators so this is a very very flexible smooth RSI and I’m going to be publishing this now so if you have been following along if you’ve watched this video so far today and find this very interesting please like and follow the channel I’m gonna be doing a lot more I know this was pretty long stream I really wanted to make some content because I had to restart the channel after a long absence so this is I think a very good video to show you how you can kind of create an indicator from scratch by borrowing some of my already existing code always check out my trading view profile big bits IO see where we’re at now 1200 yeah doing pretty good I’m posting all the scripts here as they get finished okay so you’ll see this smooth the RSI is gonna show up shortly here and some of the ideas that I’ve had here and I’m actually want to check on this one with the etherium Bitcoin cars I’m really excited about that one oh no it’s not doing too good on that’s the last few minutes but I forget I’m on the 1-minute chart so let’s go back to the daily here okay yeah it’s doing just fine on the daily that 100 day moving average is coming through here oh it’s fine but that’ll do it for this video thank you all for watching and I hope to see you again soon thank you you