Transcript
0:00 In today's video, I'll be going over how you can connect Trading View indicators and alerts to AI agents, helping you become a more profitable trader. This way, you can still use your favorite trading strategies, but by connecting it to an AI model, they'll be able to make more intelligent decisions with the data, telling you to either buy, sell, or not take a trade at all. So, I'll first show you how this AI trading system works, but make sure to stay until the end of the video as I'll show you how you can create this from scratch so that you can start trading with AI today. And like always, this video is for educational purposes only. I'm not a financial adviser and this is not financial advice. I'm simply just showing you how you can use the power of AI inside your trading. Now, the idea here is simple. We'll be using Trading View for alerts and indicators and connecting it with NADN, which is just a platform that lets you create AI agents without any coding. And what we're doing inside NADN is first getting alerts from Trading View here. Then what we're doing is getting that same ticker current charts. So, we're able to see their volume figures, potentially MACD, RSI, or just simple candles. Then, with this, we can send over all this data over to an AI model, which will help us evaluate which trades to take. And then to make everything neat, it'll go ahead and send over a message via Telegram. But if you prefer emails, WhatsApp or any other messaging platform, you can switch this out. So, what I have here in our first trading system is just a very simple price level crossing alert. So what this means is that whenever price crosses a certain level either above or below then it'll automatically send over alert to our trading system here. So what I have here is just a very simple alert on Bitcoin so that whenever price crosses above 95,289 then it'll go ahead and send over a message saying hey this alert was breached here is the open high low close figures when the price crossed this specific level. And because the Trading View alert is automated, this means that every single time price crosses above or below that level, it's going to keep sending alerts over to NAND, meaning that you don't have to lift the finger.
1:50 It's going to monitor the chart basically 24/7 for you. And everything is automated so that whenever price does cross that 95289 level. So it happened today at 1020, then it'll tell us what to do. So it's telling us to skip the trade completely on Bitcoin. And the reason is because there was a strong bullish alert candle, which was that alert we set on Trading View. But the EMAs are not aligned. So this is where the extra data into the AI model comes in, which I'll show you in a little bit.
2:14 It's going to automatically tell us whether we should take a trade or not. And because we have this trading system on, this means that each time that trading view alert price crossing of 95289 happens, it's going to send over one of these messages automatically. So in our first node here, we can see when it was last triggered around 10:20 a.m. the price crossed above, so cross direction up from level 95 to 89. And then NADN is taking all of the important figures. So we have the open, high, low, close, and volume figures for the ticker. So then as a step two, what we're going to do is get the chart of that same exact ticker, which is Bitcoin at the same time. So with the chart, we not only just have the candlestick data, but we also have EMA 20s, EMA50s, and any other things you want to monitor inside a larger, more encompassing chart. Then we're going to send over all this data into an AI model. So, we give them specific instructions, which I'll go over later on in the video when we build this from scratch. So, we can see on this right side here, the decision is to skip the trade. And for the entry, they're saying do not enter now, they want to wait for a sustained close above EMA 50. And with EMA 20 turning above EMA50, so this is what I'm personally receiving. Each time we get a trading view alert, so each time that price crosses that level, I want to know whether I should take the trade or not.
3:30 And then it's telling us decision, skip trade, direction, buy, symbol, and then reasons, right? Because we don't want to blindly trust AI. We have confirmations just to add more color and risks so you understand everything that's going into the decision of skipping the trade. So what this is is basically a fully automated AI agent trading system connected to your Trading View alerts and indicators. And it doesn't have to be something as simple as price crossing. So if you want to have your own Pine script indicators, if you want to have more complex indicators used by other traders, you can connect anything. So again, the sky's is the limit on basically what you want to connect to. Now that I've shown you how this works at its core, let's go ahead and build this from scratch with a more complex indicator so that you're not just looking at price level alerts. And don't worry, I'll make this as intuitive as possible. You won't need any coding background or technical knowledge. And real quick before we continue, if you are interested in diving deeper or want custom AI solutions and automations for investing, whether you're trading stocks, crypto, or even real estate, then make sure to click the link in the description as we help people leverage the full power of AI across any asset class. So, what you'll want to do is first create a free NAT account. So, this way you can connect Trading View to actual AI models and build out full trading systems just like I showed in the video. So, I've opened up a completely blank workflow here. And what you first want to do is click add a trigger. And the trigger is what starts the whole entire workflow. So that whenever an alert happens in trading view, we want to send over that data automatically to an event here. So here, all we want to do is type in web hook and then go ahead and click web hook.
5:04 Now for the method, we want this to be post. And all this means is that we're posting data that we're getting from Trading View. So go ahead and click post. This is essentially what bridges Trading View to our AI system here. And if we're just testing this out, we can go ahead and copy this test URL, but I would typically just recommend production and turning this on so that it's working in the background. So go ahead and click this to copy. Next, what we want to do is just head over to any ticker that we want to monitor. So in our case, I have Bitcoin because it's always trading. So what you want to do is add an alert. And this alert is what's going to trigger this whole entire workflow. So, honor alert for the condition. I did price as the very first example because I wanted to show something simple. But obviously, if you're a seasoned trader, right, you have some knowledge under your belt. You typically want to look at something a little bit more complex. And this is where you can either use custom indicators or more popular indicators used by traders on Trading View. So, if we go over to the indicator section here, we can see everything we can integrate with NAD. So, if you want to write a complete custom Pine script code, you can go ahead create a script, favorite it, and then you can use it as an alert. Or if you want to use something that's already built in, they have pretty much everything that you would typically see. But I like Ichimoku Cloud. So, what you do is just find the indicator that you want to track. And again, you can make a custom one, but I'll just do this for simplicity. Go ahead and favorite this. And now, you can use this with an alert. So if we go back to the alert section here for the condition rather than just using price, we can select ichimoku. So this way each time this indicator triggers, it's going to send an alert. So we want this Ichimoku crossing across the baseline.
6:41 So whenever the conversion line crosses the baseline, which is pretty standard, then we want to send over this alert. And we want this once per bar. You want to make sure not to click only once because if we were to click this, what this means is that it's going to send over this alert only one time and then this alert will be considered dead, right? It's never going to send an alert again. Next, what we want to do is send over the right data to NAN. So in my example, you saw that I had open, high, low, close, volume figures. That's not there by default. So if we go to message, this is the only thing that would send to NAN. So this is where you can get kind of creative and add in the different data points you want. But in my case here, you can go ahead and just copy and paste what I do. This is in JSON format. So you can ask chat GBT to do this for you. It's super simple, but you can just also copy this if you want.
7:31 what I'm writing is the source trading view. So this is static data. This is never going to change. The event is the cross. The direction should be sell if it's crossing down and buy if it's crossing up. So I did sell first. So this is actually one thing we'll need to do is crossing down instead of crossing up. So this means that when the conversion line crosses below the baseline then the direction is to sell. Then we want the ticker the exchange interval time and then we want the open high low close volume figures. So this way we don't just get the information that what we're looking for crossed. In this case we also want to know the exact candlestick data. So the AI model will have more information to make and place a trade. You can copy this entirely. I think it's always important to include the OLC figures. And if you don't know what you want to include, simply ask Chad GBT. They'll be able to format this exactly. All you want to say is we're going to create a message on Trading View alerts. Now, finally, we want this to actually send over to NAN, which is our AI agent platform. And the way we connect the two is with web hook URL.
8:36 So, you want to go ahead and click this, paste in the production URL instead. Click save. And the important thing here is that if you do use a production URL, go ahead and click publish on NAND, click publish here. So this means that it's on, it's listening for web hooks, and then whenever that alert happens, it's going to automatically send the data inside here. And while we're waiting for that alert to happen, let's go ahead and create the Ichimoku crossing in the other direction. So the one we just created, let me go ahead and edit once again. We did Ishimoku conversion line crossing down from the baseline. And then because it's crossing down the message that we want to send over because it's just saying cross is the event but the direction is sell because it's crossing down we need to do the same exact alert but to buy. So what I did was the same exact alert. So I have Ichimoku conversion line but this time it's crossing up right interval is still 1 minute. It's still triggering once per bar. The message looks the exact same. We're still sending the open high lows close volume figures. The only thing is the direction is buy. If we do crossing up specifically, we'll know crossing up is a buy signal and then crossing down is a sell signal. And then for the notification, again, just paste in the exact same web hook URL, which is the production URL. And then again, make sure that there is a green check mark here. If there's a green check mark, that means it's published and it's actively listening for events to come into this web hook. So, now that we've waited a bit, we have the alert actually go in through Trading View. So, I went ahead and let the alert run for a while and we can see inside Trading View, if you go to the logs, this Ichimoku cloud actually hit today, January 18th. So, we have a ton of either crossing up or crossing down, meaning that this data should have gotten sent to NAN. So, now the way we actually work with this data is go ahead inside NAN to executions and then you should see the last times that the data was successfully sent. So, we can see it was sent today and this is our web hook node here. It was sent today at 9:59, another time at 8:42. So this means that the alert hit crossing up or down 8:42, 9:59, also at 7:54, 717, etc. So whichever one you want to just work with and test, just choose any of them. Honestly, any should work. Just go ahead and click copy to editor. And now with this, we're able to work with that data to essentially create the rest of the steps in the workflow. Test, make sure everything works. And then once it looks good to go, we can get rid of the test data and then have it run live. So by clicking copy to editor, we can see all the test data. So the Ichimoku cross happened. So it was crossing up signal by on Bitcoin. And then the time was January 18th at this time. and these are the open, high, low, close, and volume figures. So we can see that it is working perfectly. This is just the last time that the alert did hit. Now that we have the candlestick data, what we need to do next is grab the current chart and this way we can send both the chart and the candlestick data to an AI model which will help us make intelligent decisions. Click add a node and then on this page here just type in http request and select this right here. Now in this section what we're going to do is use a free software called chart- img. And what this lets you do is get current trading view charts on any ticker. And it can be as advanced or as simple as you want. So all you want to do is head over to chart-img.com.
11:58 So you can see the website here. And then under their free plan, if we scroll down here, you get a daily limit of 50. So what this means is that you're able to send over 50 free charts every single day. So if you have an alert that's only hitting like 10 times a day, this is completely covered. So after you created an account, just go ahead and click API documentation. And this shows you all the different types of charts you can send over to an AI model for that ticker. So if you were to scroll all the way down here, I can even click it into trading view snapshots. These are what the charts look like. And what's cool about this API is that you can actually customize the chart to look however you want. So first you can change the theme, right? So if you want a dark theme chart, you would say theme and you can honestly just copy this exactly. In this case, this is a 1 hour chart, dark theme, the height of 300. Then if we scroll down, here's another example.
12:48 This is a Tesla chart. This one has a higher height. And then the interval now is a 15-minute chart. If we scroll down, this is Microsoft. But again, these are all the different examples, right? So if we type this in, so dark 1 minute and then Microsoft as a symbol. Then this is the chart we get. We can see that at the bottom, they also have volume overlays and the MACD indicator. And that's why we have a MACD chart right here just below the candlestick data. So, if you like this chart, right, if you're looking at this as a potential indicator, just simply copy this whole entire request and then paste it into NAND. but if you want something a little bit more customized, you can scroll all the way down here and it shows you all the different indicators that you can add to the chart. So, here we have advanced decline. If you want to use the moving averages, if we scroll down, we have average directional index, average, true range. These are all the example charts, what they would look like. the RSI charts. This is what the dtrended price oscillator looks like.
13:46 This is the directional movement chart. So again, any chart the lefth hand side here just tells you all the different parameters you can set. So for example, on trading view, if your alert has to deal with this, then you'd obviously want to send the same type of chart to the AI model or you can look at two different indicators, right? So you can look at Ichimoku clouds as the indicator alert and then a completely different type of chart to try to validate two patterns. But in our case, we're looking at the Ichimoku cloud. The way we can simply do this is just copy over this whole entire example. So you see we're adding the Ichimoku cloud as, you know, an indicator. So the first thing in Nadn is go over to the URL and then paste this in exactly. So again, I just copied this straight from chart- img. What we're doing is taking advanced charts.
14:30 So what we have is API-chart img.com/v2 because we want their version two charts view advanced chart-s storage. So next what you want to do is send over headers. So what you want to do inside this name is type this in exactly x-api- key and then the value is your API key from chart img. And the way we can test that this works is you want to send a body. So, what you want to do for the body content type is JSON here. And then click use JSON. And this is where you can just simply copy and paste. But we only really care about this Ichimoku cloud section here, right? We don't need any of these overrides. And we also need to specify the symbol. So, this is an example, but we need to have a bit more information like this is just telling us it's a dark chart with Ichimoku cloud as a indicator, but we also need the symbol and other things. So, if you scroll all the way to the top, you can see that this is how it's generally formatted. So this is a request example here where they have the actual symbol. So like Tesla America- New York. So if we were to copy this and then paste it into this JSON right here and then click execute step, you should see an image link for the actual chart. So here we have the URL. So simply copy this and then if you paste it into a new tab, this is what the chart looks like. So this is Tesla on the 15minute and this is literally today. So now all we need to do is combine and make like a Frankenstein type of request where we have the symbol or ticker, we have the time frame, but we also want to add the Ichimoku cloud.
15:59 And we also want to make sure that the symbol here is not always Tesla. It needs to depend on the previous alert. So I'll show you exactly how to do this. Delete this right here. And then you can just drag in the symbol from the web hook. So because we're connected to the web hook here as the first step, we're able to reference all of the web hook data figures. So if you scroll down, all we care about is the symbol. So simply drag this in. So symbol says Bitstamp Bitcoin USD. This one we're looking at.
16:25 Drag it back into here. And then here we can see the symbol is now going to change depending on the alert. So if our alert in the first step here was on ETH, then that same symbol gets sent here, right? Because we're not making it static anymore. It's dynamic depending on the previous step. And now just to make it easier, I've gone ahead and changed the actual inputs completely. So rather than just getting a simple bitcoin chart, you can see inside the expression I still have the theme as dark but now the interval is 1 minute.
16:56 So interval m because obviously if it's one then it's 1 minute and then just simply drag in the interval right here. So interval one override this is if you want any overrides and then the studies again I just simply copied in the Ichimoku cloud. So this is exactly what I showed you. We're essentially combining the indicators with just the base information like the theme symbol intervals. So this way we're able to have all this information inside a chart. Now if this is a little bit confusing, you can have chat gbt create this completely for you. Just say hey I'm using this chart-img service and I want to create request for you know bitcoin with these specific parameters.
17:35 And then once you've done all that just go ahead and change the method to post just like we did in the first step as well. So now we have the method as post. We have the API keys and then we have our custom Ichimoku cloud request and then we get the URL chart. So if you were to paste this in, we can see we have the actual Bitcoin chart on a one minute time frame with the Ichimoku cloud right here. And then I also added in MACD below which could be helpful, right, for evaluating whether this is actually a good buy or sell signal. Then as a third step, what you'll need to do is super simple. We have the chart URL, but we just need to extract the information from the URL and make it readable for an AI model. So, what you would do is click add and once again just make another HTTP request. Drag over the URL from the previous step. And if we click execute step here, we can see that we have the actual files. We can view it. And this is what the chart looks like. So now we can tie everything together by now adding in one final node. And then what you want to do here is just type in basic LLM chain. And then for the source for prompt, go ahead and click define below because we're going to make our own prompt here. And now before we create this master prompt, what you want to do inside chat messages is click add a prompt because we want them to take this image here and be able to see it and factor it into their analysis. So click add prompt. And then what you want to do is keep this as user. For the message type, we want this to be image binary. What we're doing here is taking this image, it's called data. So the image data field name is data and then the image details we can keep this as auto. But what this is doing is taking in this image exactly into the prompt. So this way we don't have to do anything with the image.
19:14 They'll be able to read it. So now that we have the image done, we can actually work on the master prompt. And feel free to copy mine exactly or work with chat GBT to create your own. But I'll go ahead and show you what I wrote and what I found works well for me. So what you want to do is go ahead and click expression and open this up. And the reason for this is because we want to reference the previous steps. So we have the web hook that has the open, high, low, close, volume figures. We're going to need to drag this in to our prompt.
19:39 And then again, by dragging it in, it's going to be different each time depending on the alert. So let's go ahead and paste in my prompt. You are a conservative trade validation agent. You do not invent trades. You only validate whether a Trading View Ichimoku alert is tradew worthy or just noise. So again, you would change this to whichever alert or indicator you're using, but what you will receive is the alert fields. So this is going to tell us, you know, whether it's a buy direction or a sell direction. And again, this is whether it's crossing up or crossing down. We also want the candlestick data of the trigger candle. So this is when the crossing up or down candle occurred.
20:16 This is the open, high, low, close, volume figures. And then secondly, we're sending them a chart image showing the candles, showing the Ichimoku cloud volume and MACD. But what we have here is that this alert triggers only when the crossover is confirmed. Assume the alert is set to once per bar close. These are all the settings that we set in trading view. We have the O LCV figures provided in the closed candle that confirms the crossover. And then the chart image is the broader context.
20:42 Now below here, I'll walk this through with you to show you how you can drag all these fields in. So for the symbol, let me go ahead and delete this. If you scroll all the way down, let's just simply drag over the symbol just like so. And then the event is going to be ichimoku cross. Just as important, we need to know what direction the alert was. So this was crossing up which is by. And then we don't need to send over the chart again because we defined it as the binary image field. So here we're just saying chart image is provided as binary data. And what we want to do is only output take trade when the crossover candle looks real and the broader chart actually supports it and then default to skip trade when uncertain. This makes for a more conservative analyst. Validate alert basics, trigger candle quality, when it's considered buy, when it's considered a sell. And this just adds another level of nuance to just indicators, strategies, and alerts. And then we have step three, Ichimoku context check. For buy, again, we have rules. For sell, once again, we have rules. And then we can skip if price action is choppy or sideways. Then we have MACD volume confirmations. If we go to step five, it's risk and execution rules. when to take trades. So again, this is all pretty complex, but I worked with ChatGpt on this and you can do the same. And if you do want this exact output, you'll be able to find it on my website in the description. So completely free if you just want to be able to plug and play the system in. So now scrolling down, this is important.
22:06 What we want is the output requirements. So we want to provide the answer as plain text. We don't want to output JSON. We don't want to output markdown code blocks. No extra sections. And this just makes it easier for us to read. So we want this exact format. The decision whether to take the trade direction symbol time frame confidence quick reasons. This is just so you actually understand why they're giving you the reason because AI is only as good as you let it be. But you also want to have some human element. We have confirmations risks and that's pretty much it. So now as a final step we just need to add an AI model. So click add here. Select OpenAI chat model or any model of your choosing. You can use claude. I would do anything five or higher. Even five mini should work. And then now if we click execute step, it should show the full output. And awesome. We see node executed successfully. Let me go back to the output. And this is what the text looks like. So it's saying to skip the trade direction was crossing up. The symbol again was Bitcoin. The reason is because the trigger candle was technically strong, but the Ichimoku cloud placement is unclear or marginal on the chart. So now for this final step, you can choose whether to have this information presented to you on email, Telegram, WhatsApp, etc. But for my case, I'm just going to use Telegram since it's pretty easy for me. So just type in Telegram here and then we can send a text message and then we're able to send the information. So all you want to do is simply drag over the text and then get the chat ID of whichever Telegram account you're using. So once it does look good, just go ahead and click execute step. And then if we go over to Telegram, we can see the text was just sent over today, January 18th. We have the decisions skip trade. Same exact message. It's just a little bit easier for us to read. And because it's in Telegram, we're able to receive the alerts immediately. And now what this means is that this is actively listening for alerts. So each time an alert happens, it's going to go through all these steps and you don't need to do anything. So if it's Gmail, it's going to automatically send you emails every single day. It's Telegram. Just make sure you have notifications on and you'll get all those trade ideas automatically. And if you found this video helpful, make sure to like, comment, and subscribe as it greatly helps out the channel. So I'll be covering everything regarding using AI across investing, many different asset classes. So we have stocks, crypto, real estate, and everything in between.