Convert TradingView Indicators into Strategies with AI (IT FINALLY WORKS)
https://www.youtube.com/watch?v=ETuIpsL_7Mc
Transcript:
That’s right, guys. In this video, you will learn how to convert an indicator into a strategy using AI. Finally, this is the method that will help millions of people to do that. And after my last video, where I took the top five indicators, I converted them into strategies while coding. I did it myself.
You guys asked me, okay, Michael, that’s all great. You showed us that the indicators that we’re using are not all so great and we should use strategies, how to freaking create strategies especially when i have an indicator it looks great how to convert it into a strategy well that’s why i’m making this video because i wanted to help you and i found the method guys okay i found the right ai the right prompt that you can use to make this happen and in this video I’m going to show you all of that. This video will be less cutting and more raw because I want you to also see the
problems that can happen and how to solve them. There are not a lot of problems, but a couple of them might happen. And I want to show you how I do it in real time without cutting out all of those errors, right? So guys, if you love that, make sure to destroy the like button. Okay, massage it, cuddle it, love the like button.
Just click on it because I am making these videos to change your life, to give you game-changing educational content on this channel. While this is not financial advice, crypto is risky. You can lose all of your money, but that is why you subscribe to this channel. You watch the videos that I make because that increases your chances of success, guys, right? That’s the whole point.
We have to be better than other people because it’s a player versus player game. So let’s get into this video. Let’s learn how to create a strategy from an indicator with AI. It’s going to be awesome. Let’s get started. I’m very excited to show you this, guys, because it makes you independent and gives you so much power, right you can turn any indicator into a strategy and you can create even completely new strategies you can combine different indicators into a strong strategy but let’s get step by step into this topic right first of all we’re going to convert three indicators into strategies using open ai
and let me show you which open ai we’re going to use because you have to use the right one. So you have to use ChatGPT-01 preview. That is the one that gives the best results. And that’s why I’m so excited about this method, right? I have had a couple of conversations. As you can see here, we have the bull market support band conversation, Supertrend and Bollinger Band. And the results that I got, guys, are incredible.
Okay okay so this is my version of the strategy right producing 736 profit with these other KPIs and when I turn on the GPT version of that strategy turning it on now you can see the exact same results okay that is fascinating the next thing is the super trend strategy, my version, right? With 530% profit and GPT version, 530% profit. Exactly the same. Yes, it’s a lot of stuff in the chart, but just to show you that this AI version that we’re using here to create strategies produces very good results.
And I want to show you how to do it yourself right now. All right, guys, let’s start with a bull market support band. This is an indicator that you have seen in my previous video that looks like it’s actually quite nice because whenever the lines cross, right, to the upside, there might be a good buy signal.
And then when they cross to the downside, there might be a good sell signal. So let’s convert this idea into an actual strategy, right? So first of all, bull market support band, let’s add it to the chart, click on indicators first of all bull market support band let’s add it to the chart click on indicators search for bull market support band and click on this one you will have it on your chart it will look the same as mine now the next thing you need to do is you need to hover with the mouse over this indicator here and click on the source code because you need the code to
give it to chat gpt right to convert it into code into a strategy so click on that and here you get the code of that indicator just copy it right just copy it as it is and go here to the prompt which is below this video copy paste the prompt and everything and in this prompt you have three sections and before i put the code let me explain the sections the first section is basically telling chat gpt what we want from it and also we are giving it a good confidence saying hey you are a professional pine script
version 5 developer right so that it does the right thing for us the second section is giving it instructions on how to behave in certain situations which settings to use per default so i have put this together carefully so that we avoid the common issues and the third section is the code of the indicator right so i’m telling it hey this is the code and here i paste the code right and that’s it you don’t have to change anything else now copy the whole thing right and now go to chat gpt and open a new chat and make sure you are on the 01 preview version
that’s the only one that actually makes sense and just paste the whole thing and let’s give it the first try and see what happens now what will happen here is that it is thinking you see that it’s not immediately answering because the 01 preview version is a better version that is actually thinking about its actions before giving a response which is professional right so that has resulted in amazing results for the strategy creation and after like 40 seconds 60 seconds something like that it gives the first
version of the strategy so usually there are tiny issues in there but they’re very very easy to fix i will show you exactly how to do that after we get our first version. All right, after 49 seconds, it gives us the first version. Let’s copy the code without even looking at it. And let’s create the strategy.
Back in TradingView, right, you see here that you cannot edit this because you need to create a working copy. That’s perfect. So click on create a working copy, right? Click on that, you get a new script with no title at all. Just delete everything inside and put the code from chat gpt here right and then click save click save again and let’s see what happens is there any error no no error so far if there was an error i would show you how to fix it but i’m sure it’s going to happen in the next indicator now the next thing you need to do is you need to add it to
the chart and let’s make sure i am not in the way no i’m not in the way that’s good so add to the chart so now you need to click this button to add this strategy to your chart to start seeing the results all right so we have added it to the chart and as you can see here it produces well quite good results not exactly the same as mine so mine was let me open it right now mine was 736 profit well this one is 383 profit but hey still not bad but now i want to create the same result as my strategy but how can you do it right how can you double check
if it’s actually done the right thing or not well it kind of depends on you as well because when you look at the indicator then you have to make sure that this buying and selling arrows right that you see here that they’re happening at arrows, right, that you see here, that they’re happening at the same time as when you would buy and sell based on the indicator.
So now you have to use your own mind and come up with something that you would be doing as well. Now, as you can see here, there is a cross to the downside. And after the cross, there is a sell signal, should be a sell signal, right? Now, when I turn on the strategy again, we can see that it is selling, but it’s a bit later.
Let me double check here if that is the case. Yeah, so it should sell here, right? Because this is the cross of the indicator, but it sells way later. So for me, that looks like it’s selling when it goes below the line instead of selling when there is a cross. Let’s see, let’s go back to the ChatGPT version and let’s tell it that we want to buy when there is a cross to the upside of these two EMAs and then we want to sell when there is a cross to the downside. Let me formulate a sentence and come back
to you. Okay, so I’m telling it to buy when EMAs cross to the upside and sell when ema is crossed to the downside and i don’t know if you noticed but there are these strange staircases that happens because the strategy is actually going to the one week chart to get the numbers on the the prices and then creates the results on the one day chart long story but if you don’t do fill gaps then it will look like that so i am telling it and i told it already by the way to fill the gaps but you know sometimes it doesn’t stick to
all the rules that i give it it says here fill gaps right so it didn’t do that so i will tell it to do that now okay so i’m saying also fill gaps to avoid jumps in the lines, in the lines. So let’s click enter and see what happens. Okay, we have a new version. Let’s see if that works out. So we have here gaps off.
That’s not really smart, right? Because yeah, that’s the whole point of filling gaps. So they should be on, but okay, like it’s not the end of the world. And so let’s copy this code and go back to ChatGPT. And by the way, if you want to make sure you’re editing the right code of your strategy, then click on these source code brackets and you’ll arrive back in your own code.
You just delete everything in there, put the new code, click save, and then see what happens. Okay, it didn’t fill gaps, but let’s see about the profit results. And now it looks like it has the same exact outcome. Yes, it has the same exact outcome as my strategy so there you go guys we have managed to convert an indicator into strategy and it does exactly the same as i would do right so doesn’t get much better than that i hope you learned how to do it now let’s go to the next one and do it there as well because i want
to show you as well a situation where there is an error in the code and how to fix that okay guys the next strategy that we want to create is from the bollinger bands and the reason is that simply is the best one from my previous video it makes the most profit so i think it makes sense for you guys to know how to do exactly that one and so first of all you have to add the bollinger bands to your chart go to indicators search for bollinger band and click on the technicals right this is the bollinger band indicator that you want to add to your chart
click on that and then you see exactly the same as i do we are still on the bitcoin one day index chart guys right and now again you need to use your brain a little bit to zoom into the chart and understand okay when would i buy right because again it’s an indicator it doesn’t have buy and sell signals right so when would i buy and when would i sell and to make it faster in this video because i already explained it in the previous video i would buy when the price goes above the upper band okay and then stay in the trade for as long as the price goes below the lower band right
so quite long and then it will sell here, right? So that would have been a very nice trade, buying here and selling roughly here, making 356% profit. So let’s see if that idea leads to a lot of profit in general, because sure, nice that it worked here, but does it produce false signals? Does it have a high drawdown? All of this stuff.
Okay, the same as before, we go here with the mouse mouse we click on the source code i will make this larger i will just copy the whole indicator i will go to our prompt and i will make sure to delete the previous code here and put the new code right copy the whole thing again go to chat gpt open a new chat make sure you are on the o1 preview and put the whole prompt in there click enter and get a coffee while it is thinking man it’s thinking for a long time what’s happening okay 41 seconds i don’t have any patience guys okay anyway so this is nice let’s see if it works
but for sure we’re gonna have to tell it one more time when to buy when to sell because we just told it hey convert it to a strategy and it made up its own mind when to buy, when to sell. You can see here the long condition has something to do with the date range. That’s fine. But also it has to do with the crossover. But let’s see if it does the right thing.
Just copy the code, create a working copy, click on this blue text here, right? Just is in there put the code from gpt click save click save again and now let’s hope that there are no coding errors okay no coding errors there that’s nice and now again click on add to chart okay this one here okay we have it on the chart and well it doesn’t make money right it’s actually losing money but that’s because most likely it would just do the wrong thing so we have to tell it when to buy and when to sell. But the first thing that we should be
doing is checking if when we turn off the strategy and we turn it on again, if, you know, the Bollinger bands, they overlap each other, right? So that is the case, which is very nice. That means that it turned the indicator into a strategy. So that’s cool. But then it doesn’t know when to buy and when to sell properly, right? So it buys here and then it doesn’t know when to buy and when to sell properly right so it buys here and then it sells like whatever okay we want to do other things so now i have to formulate a sentence where i tell it that when the close price goes above the upper
band buy right and when the close price goes below the lower band sell which is definitely not doing right now you see it does something totally different okay so go back to gpt and let me formulate that sentence and come back to you okay so i’m saying thanks you always have to say thanks okay you get better results like this yes be friendly guys right even to the ai you never know when the ai will be in the form of a robot in front of you and you can say i was always nice to you, please take care of me, treat me nicely as well.
Okay, I’m just saying. Okay, so thanks, but now change the buy condition to buy when the close price is above the upper band and sell when the close price is below the lower band. And so guys, keep in mind that you have to necessarily have some plan, okay? You cannot just hope that there will be the best strategy on the planet coming to you for free, right? You have to think a little bit.
So you have to go to the chart, zoom in and think, when would you buy? When would you sell? And just tell it to the GPT, right? And then it will create a strategy. So that’s the thing, right? When you create a strategy from an indicator, you have to define when to buy and when to sell exactly right not just an indicator an indicator always looks great with the eyes but then when you actually trade it it’s not so good that’s why i’m making these videos guys to show you how it’s done and how to evaluate this stuff okay okay 16 seconds not a lot of time so it was quite fast let’s just copy this and hope that
it did the right thing and again let me click on these source code brackets just to be sure i’m editing the right thing delete the whole thing put the new code click save and let’s hope we have better results this time so this time wow it looks very nice thousand one hundred eighty seven percent profit right so way better but before we compare with mine let’s just zoom in and see if it did the right thing so you see it is buying when because this closed above this closed above the line very slightly so it bought on the next candle right so that’s nice and then here you can go and see that
it actually sold when the candle closes so it sells it sells on the next candle the first second right that’s why this candle closed below boom the next candle is the first, second, right? That’s why this candle closed below, boom, the next candle is a sell signal, right? And that’s, by the way, best practice.
You should only act on candle close because otherwise you get faked into a trade or out of a trade, right? So if we now activate my strategy, which is, let me zoom out to find it. It’s here. This one, you can see it’s exactly the same net profit exactly the same drawdown everything is same so guys there you freaking go guys we converted two strategy two indicators into strategies got to the same result as before and we still don’t have coding errors so i’m guessing i have to go to do one more strategy for you as a bonus we’re gonna do the
super trend as well next let’s go okay guys this is the super trend indicator click on indicators search for super trend and in the technicals click on super trend okay yes there is a strategy but the whole point of this video is to show you how to convert any indicator into a strategy okay click on super trend and then you will see pretty much the same you see the same as, right? So when would you buy and when would you sell? You have to always ask yourself that question before creating the strategy.
So I want to buy when it’s green and I want to sell when it’s red, okay? Like very simple, right? And so I don’t know yet how to tell it to GPT. We’ll figure this out. But that’s what I would do here, right? So yeah, there will be a lot of fake trades as you can see here so buying here selling here so here you lose money right here you almost like you lose a little bit of money here right so you will see guys so first of all like always we go to the source code and we copy the whole source code and we go to our prompt we delete the previous
code that we had we put the new code we copied the whole prompt and we started new conversation in gpt make sure again 01 preview not anyone else any other version it wouldn’t work okay click enter and let’s wait for the first result of course like i said we have to still tell it when to buy and when to sell but let’s see maybe it does it correctly in the first try maybe it does it correctly in the first try okay after 43 seconds we get our first version and let’s see how that performs on the chart copy the code right and go here click on create
working copy delete everything put the new code click save click save again and no coding oh coding errors perfect because well we wanted to have this issue right so that i can show you how to fix it so you just copy this error right you copy this error right and you make sure to tell it that it’s in line 26 okay so let’s go back and say in line 26 we have have this error right put it there click enter and now it will fix it hopefully let’s see what i’ve also seen often is that when i start a chat and goes in the wrong
direction and i can’t make it work then it’s simply better to just start a completely new chat from the scratch the same prompt okay and then it will result into something useful. That’s crazy, but that’s what it is, right? So sometimes it just goes the wrong direction and it will never come back to do the right thing.
But hey, that’s fine. Again, it’s very easy to do that, right? So when you do this, right? A couple of times you get errors, errors, errors. You never get out of the errors, then just start a new chat, okay? So I have a new code. I put it here, save. Seems to work, great.
Click on add to chat right as always we’re gonna get a back test and the back test yeah it’s pretty bad but let’s first see if the indicator right the coloring is correct okay so you always have to do that right so by the way let’s close this and just close and open the indicator and see if they have done if the basically gpt has found the right trend and is doing the right thing as you can see it’s a bit funny because it’s actually buying when the trend is red and it’s selling when the trend is green so well that’s stupid right has to do exactly the opposite so i go back to chat gpt and i’m telling it to switch around the buying and selling.
As you can see, the sentence is, okay, but now buy when the trend is green and sell when the trend is red. Exactly the opposite of what you were doing. And let’s see what happens. Okay, guys, after 31 seconds, we have a new code. Let’s copy it here. And let’s make sure we’re editing the right indicator, the right strategy, actually.
Click on this and let’s make sure we’re editing the right indicator the right strategy actually click on this and let’s copy well not copy but delete everything put the new code click save and let’s see if now it is doing the right thing let’s see the strategy tester so now it makes money so that’s already way better than before right and let’s zoom in and see if it makes does the right thing when we look with our own eyes, right? So it’s green, it’s buying, it’s red, it’s selling, green is buying, red is selling.
Looks great, right? So let’s look at the result again. We have a drawdown of 47. You know all of that from the previous video. But let’s also check if it has the same profit as my version, right? Okay, so that was the super trend strategy. This is my super trend strategy. This is my super trend strategy.
As you can see, the results are exactly the same, guys, right? So now you have seen all the cases that can happen, right? We had a coding error. We just told it in which line is it? Tell it the line. Otherwise, it’s a bit confused. And it fixed it itself. Then also we told it when to buy, when to sell sell and it did that as well now if you are super cool right because that’s very easy right to convert indicators into strategies you can say you want multiple indicators right to be combined into a strategy but that is a bit more advanced and I might make a video if I get enough likes on this video if I
get above 100 likes I will make that video as well guys you see guys it is very easy to do if you’re using this method we went through all of the issues that you can have there are not so many because it’s actually a very easy method right the only thing you need to do is you have to have a subscription for the chat gpt version that i mentioned but once you have that you are fully free to create any kind of strategy from an indicator that you want.
Gone are the times where you have to ask me to create a strategy from an indicator. Now you can do it yourself and more, guys, right? You can go bananas with this, right? You can create your own strategies. And by the way, once you have a strategy and you want to fully automate it, then head over to signal.money.
it, then head over to signum.money. As you know, this is my software for automating any trading strategy whatsoever without having to put anything special in the code. You just create the strategy normally and then you can automate it with Signum to buy and sell for you fully automatically on your exchange. I do that. You can do the same. It’s very easy.