00:00I've been using Cloud Code, Trading View, and various other AI tools to build a pre-market scanner, strategy filters, and a Pine Script strategy on Trading View
00:09And I'll show you how to do so in this video
00:11AI is a talk of the town
00:14While you see a lot of AI enthusiasts on YouTube integrating Claude or Codeex with their trading view, and those videos are great, don't get me wrong, but they're not traders after all
00:26Remember AI is mostly just slop without specialized knowledge behind it
00:31Trading is the same
00:31You need real trading experience first
00:34Then AI becomes a tool to sharpen your edge instead of generating generic strategies
00:41The thing is AI won't magically make you profitable
00:44So today I want to show you my take as a full-time trader with more than 10 years of experience
00:51How to automate your trade planning process with claude code and trading view
00:56So here's what you'll learn in this video
00:58First, how to set up trading views connection to claude
01:02All the potential use cases and how you can overcome the limitations
01:04Number two, how to create your own pre-market gap scanner and news briefing
01:09Three, create your own strategy, then back testing your own strategy on Trading View with Pinescript
01:16Number five, more AI trading automations sending alerts straight to your phone
01:22And finally, the bonus chapter of this video, how to use Trading View's own AI that's still in beta
01:29Before we start, I just got to say this
01:32I'm not a technical person
01:32I have no background in coding or tech, but I am a trader and I'm leveraging AI tools to automate and optimize my process today
01:42So, if a non-technical person such as myself can do this, then so can you
01:48Today's video is jam-packed
01:48If you're ready to follow along, make sure to drop a like down below and subscribe because I'm about to release a lot more videos about using AI to level up your trading
02:00All right, let's start with setting up trading view connection to clot code
02:05I'm not going to spend forever here
02:07You can just read this expose over here, which I'll link down below
02:11The author breaks down all the technical details of how uh Claude can now read the charts source code
02:16So, props to this guy for figuring out this MCP workaround
02:22I made some modifications and simplify this process
02:27So, you can easily copy and paste all the prompts that I'm using for this video demo and to set up my trading AI pipeline in the video
02:33The link is in the description
02:36So, to start, here are the two things you need to get right now
02:39Go to claude.ai AI and install cloud code on your desktop
02:43And number two, you need to install Trading View desktop version
02:47So you cannot use a web
02:50You have to use a desktop like the one you're seeing seeing right now
02:51This is running on my Mac
02:54So here's the caveat
02:56You need to do this trading view and cloud connection on a Mac OS
02:58I first tried it on my uh PC computer right here and it didn't work because of the desktop file on the official website
03:08it's like a different Microsoft file or something like that
03:11It doesn't matter
03:13I'm not technical
03:13I just trade
03:16So, if you run into that problem, just ask your AI to solve it for you
03:18For the subscriptions for Claude or Codeex, which you can do the same thing here, too
03:25You need at least the $20 per month paid plan um at least to get started
03:28Um for me personally, I'm using the max plan, which you can see on screen over here
03:35Um, I'm using the $100 a month plan and that's enough for me or for all the things I'm doing
03:40As for Trading View, you need a paid Trading View subscription to do this connection
03:44At least the essential plan, the cheapest one, I think it's about $13 to $15 a month
03:52If you use my referral link down below, I believe you get $15 credit
03:54So, that's going to help you get started
03:59Once you have these two subscriptions and a desktop installed, you're finally now ready to get started
04:04So just go to step number three on my blog and copy this into cloud code
04:09Essentially that installs the MCP
04:12You copy from this GitHub over here which is the one that you can see from this expost
04:19You can verify
04:21You can see a lot of people watching it and using it
04:232.9,000 stars
04:27So this is legitimate and that's the one I personally downloaded as well
04:29So once you copy that, you just enter
04:35And during this process, Claude is going to ask you a lot of different permissions
04:38So you can just read the different prompts and follow along
04:40And once it's done installing, you're going to have to restart Claude
04:43Once you restart it, go to a new session and copy this prompt and run TV health check and tell me if Trading View is connected
04:50So just run this prompt
04:53So you can see now that you run the prompt, it's showing that Trading View is connected
04:57Um, by the way, your desktop obviously needs to be open right now
05:02The link is live and API available
05:04The chart is now on NASDAQ AMD on the one day chart
05:06Let's check if that is correct
05:12Okay, so that's the daily chart on the NASDAQ
05:13Okay, great
05:13I'm going to simplify this and go to the five minute chart because that will be the chart that we'll be using
05:19Now that the connection is established, you can try and test out some really basic prompts
05:26It can do almost anything as long as Claude can read all the different candlesticks on the daily chart and the essentially all the source code behind it
05:35Let me just do a quick demo right now
05:37Can you draw the levels for Intel? Um draw the recent higher days
05:41Um the pre-market highs and lows and the 50 52- week highs and lows as well as alltime highs
05:57So you can see Claude is switching time frames live
06:04Okay
06:04So you can see Claude has just drawn the 52- week highs and they actually have like different styles and labeled it as well
06:11That's pretty cool
06:13Um daily highs, daily lows, pre-market highs, pre-market lows
06:15Okay, now that you've tried the basic use cases, let's move on to what actually matters for active trading
06:22The goal for me today here is very simple
06:24I want to build a complete pre-market trade planning pipeline from scanning for stocks to trade to building my strategy and then back testing it
06:33Now remember I did mention earlier that trading view and claw connection
06:38Right now there is some limitations
06:40One is that trading view cannot scan the entire market for you all at once
06:45It's only able to scan and provide you data on a basket of stocks that you selected and told it to do specifically
06:53But no worries, there are some easy workarounds for this
06:55And it's really fast, too
06:58So, what I decided to do, which is way faster and simpler, by the way, is to create a preliminary pre-market scan, which will give me all the top gappers, and then put the results from that first scan, I call it scanner A, into my strategy scanner for my strategy to trade
07:16That would be scanner B
07:18So, let's build that right now
07:20What I'm going to build first is a simple pre-market scanner
07:22All right, let's start building the pre-market scanner
07:26Now, there are two or three prompts to use and you can copy them from my blog post here on my website
07:34It's free
07:34You don't even need to enter your email
07:36Let's start building the pre-market scanner
07:38Now, if I go to my blog post, so I can just copy it
07:41Uh, this one, copy, paste
07:48So, you can see that I'm asking to build a pre-market scanner every morning before the open
07:52Build me something that does this
07:54So, I'm scanning for all the criteria we just talked about
07:57Stocks that moved up more than So, I'm scanning for the big movers for my trend join loan setup
08:04By the way, stocks that gap up more than 5% from previous day, price above $3 per share, and over 50K pre-market volume
08:12Um, you can obviously adjust that to however fits you better, but for me, that works
08:17And I'm actually going to go to uh auto mode, so stops asking me for directions
08:26And then you can see that I tell it the news catalyst source to use
08:28So for the tickers and the percentage I'm fetching from Yahoo Finance and for the briefing uh news catalyst briefing I'm sourcing them from as you can tell Benzinga and then I tell it the format I want to see
08:44I want to see ticker price gap percentage then one catalyst sentence
08:49So it's building that right now
08:49So this process should take you about a minute or two minutes especially if it's your first time doing it
08:56Um but so give it some time
09:01Amazing
09:01So you can see these are the results that gave me for um the gappers
09:07You can see the gappers pre-market
09:09Today's a Saturday
09:09So this is obviously not from today
09:12This is probably from Friday
09:14Stocks over 5% price about $3
09:18top 10 gappers and the news catalyst
09:18So you can see the tickers sedg, Figma, EMP, VG, Wayne, team, and you can see all the catalyst and you can see all the results each morning is saved to a new JSON file with a date specified
09:32And don't worry, later I'm going to show you how to deploy and send that pre-market scanner results to your phone every single morning
09:43Now, let's move on to the strategy scanner filters
09:45Now that we have the pre-market scanner down, let's dive into strategy building and the scanner behind it
09:52I'll be demoing today with my favorite set strategy, which is the trendway long setup
09:56This is my favorite setup that I mentioned in so many of my YouTube videos
10:01And by the way, every single weekend I curate a watch list of three to four trade ideas based on my strategies
10:09You can get that for free by signing up with the link down below
10:13I'm also developing a lot of AI tools to help traders level up their day trading and swing trading
10:18So, make sure to stay tuned
10:21We're going to build the strategy scanner filter to read all the results that we've generated from the pre-market scan
10:28The strategy filter essentially will tell you which of these candidates are valid for entries and exits
10:35Now, to build this trend long strategy scanner, you just need to copy my prompt here
10:39Don't worry
10:39Uh I'll show you exactly what it is
10:42So let me copy and paste
10:44Now it's building
10:44So essentially you can extend it and see that I'm asking it to build a trend joint long strategy scanner that filters stocks down to which ones that meet my day trading entry criteria
10:55I'm asking to do a test
10:58You can see it's doing a test on AMD, Nvidia, MU
10:59And these are the prerequisites
11:02So while it's running, these are the criteria I'm asking it to build for the strategy scanner
11:08Number one, I wanted to run after 10:00 a.m
11:10market time
11:10The price of the stock needs to be above yesterday's daily high, and yesterday's close needs to be above the 200 SMA
11:18The price needs to be above today's pre-market highs, and the price needs to be above today's high of day
11:27Essentially, again, I'm joining strength
11:28It needs to be a higher date breakout
11:30If all five of the criteria passes, then it's a hit
11:34Then now the scanner will trigger an entry
11:37The difference between this scanner and the previous um pre-market gap scan we created is that this strategy scanner needs to run on trading view
11:45That's where the connection to claude comes into play
11:50Also just make sure that your trading view desktop must must be running and the charting tab needs to be active
11:57So you can see now that it's built the second scanner
12:00So, this run was a lot faster um than the pre-market gap scan
12:05They finished building the scanner in about two minutes
12:08I think it already has a context from the previous one
12:12Now, at this point, I'm sure you're wondering, "All right, Shay, but does this strategy actually work?" Now, this is where the fun begins
12:19We can back test the strategy scanner we just created on Trading View
12:23And once again, you can just ask Claude to do this for you
12:28Okay, I want you to back test the strategy we just created in Pine Script
12:35Um, back test MU as far as you can go on the five minute chart
12:48All right, we are back
12:48Let's see what the back testing did
12:51So what it did is essentially it created like um pine strategy um on trading view and using the criteria we input earlier
13:00This is all the trades I did
13:03So there the net P&Ls
13:06Okay
13:06So you can see it gives you the date to some longs um some losses some wins
13:13Oh pretty decent a lot of greens but also like AMD has been really really strong
13:20So keep that in mind
13:23And here are the key metrics
13:23Not bad
13:25Not bad
13:25So, total P&L over 14 trades is $1,200
13:33And there's a max equity draw down here as well
13:35Profitable night out of 14
13:37Profit factor is 2.48
13:37That's really good
13:40Uh, but again, I want to caveat by saying that this is only one ticker
13:44And you can see the details they provide you here
13:47It's around the same
13:47and the initial capital we're using a thousand dollar
13:53Obviously, you wouldn't be using 100% of the equity per trade, but again, this is just a back test
13:57But again, that was a really limited back test
13:59Let's extend this to a lot more tickers now
14:02And I think I'm going to use higher time frames to speed this up
14:07Good job
14:07Now, I want to extend this back test to more tickers
14:14Uh, I want to back test on MU, Nvidia, Tesla, Apple, Amazon, Meta, Google going far as far as you can on the 15minute chart
14:32So, essentially, I want to extend this back test to all the magnificant magnificent seven, even though I don't think I got seven
14:39What am I missing? Well, I'm missing Netflix, but it's it's okay
14:42You you get the idea
14:42I want to extend this to a magnet max 7 and on the 15 minute time frame now
14:56Okay
14:56So, I'm not going to lie, that did take a while
14:58Um, but we got some decent results
15:02You can see we have Tesla, Nvidia, AMD
15:04Um, so no trades on Tesla
15:07That's fine
15:07But what happened to Google? Anyways, this just to show you that um the strategy does work
15:11But once again, it's highly selective
15:14But as you can see, since we are we were back testing on the I think 15 minute time frame, you are producing a lot less trades
15:24If you were on the five minute time frame, there will be a lot more trades
15:27Um and again, my criteria like all the ones I list out earlier is really really strict
15:32So if you want to take more trades, which you know, up to you
15:37Um I would prefer higher win rates and higher returns than to take more trades
15:41But again, you can play around with this
15:43This is just a foundation strategy for you to get started
15:45And this is where the real work comes in as a trader
15:49As you can tell, this is a really good foundation, but it's based on very selective criteria and it's only you're only back testing on only a select few tickers
15:59So, make sure you go in yourself and test out different entry rules
16:03And truth be told, I'm still in the process of testing and reiterating to make sure this applies across all the stocks on my watch list
16:12I don't have all the answers for you today, but I'll be making follow-up videos on this very soon
16:18So, I want to show you some examples of how I would reiterate and test out the strategies using Claude
16:26I see
16:26I think the amount of stocks you can back test is really limited using Pinescript
16:31I want you to switch to Python now to back test this exact same strategy and I want to expand you to you the universe to all the stocks on my watch list
16:43I believe there are around 30 stocks
16:44So expand the back test to those 30 stocks using the last 30 days
16:56So you can see Claude is now hard at work uh writing me a back testing um Python and I can uh tell it what tickers to run
17:06And again all of these prompts will be available on my blog post that you can just copy and paste
17:11But you do need to reiterate this to fit your own strategy and your own capital as well
17:21All right
17:21So that was a lot faster than the previous one using Python
17:23So you can do the same with all the other tickers you want to back test on
17:28So basically within my watch list I have 32 tickers and I was back testing the last 30 days
17:35And this is the portfolio totals and I'm trading with $10,000 account 54% win rate and a total P&L
17:46This is not bad
17:46Uh a couple of tickers with no signal Meta and Robin Hood
17:50That's fine
17:50And you can see these are the rest of the tickers and these are all the tick I thought I had a lot more tickers
17:57Oh, these are top 10 um winners, but a total all the tickers on my watches are here
18:02You can see
18:02So, I basically asked you to back test with everything here
18:06There's a total of 32 tickers
18:10Um so again, this is just an example how how you can reiterate and find anything that you can improve your strategy on
18:20This is actually really good result
18:20I don't think I had this when I first this kind of result when I first built this
18:26But yeah, play around with it
18:26It's actually really fun
18:27Okay, so far we built many things with Trading View and Claude and of course Python and other resources
18:34We built a pre-market scanner that shows you all the gappers on the day
18:39Then we built the strategy scanner that allows you to scan for the stocks that fit your entry and exit criteria for the trend join long strategy
18:48And number three, we back tested the strategy with a pine script on trading view as well as asking Claude to extend that to build a Python to for us to back test even more tickers
19:01So the next thing to build naturally is to automate everything
19:05So the scanner will fire on its own pre-market send you the alert and then the the strategy and the testing will start on its own
19:13Okay
19:13Now I want to automate both scanners
19:16The pre-market scanner I wanted to first start at 8:30 a.m
19:22market time and run every 30 minutes until 2:00 p.m
19:32The strategy scanner, I want it to only start after 10:00 a.m
19:35and run 5 minutes after the pre-market scanner
19:43And the strategy scanner is only going to run based on the tickers produced by the pre-market scanner
19:48And I want this to run also until 300 p.m
20:01Okay, I think it did it
20:01That wasn't too bad
20:03Uh that was only like five minutes
20:06Okay, so okay, let's see what it did
20:10So every job both jobs are loaded with a full schedule
20:13Okay
20:13So you can see the pre-market scanner
20:16These are the time frames that's going to run every 30 minutes
20:19So 12 runs a day
20:19Yeah
20:19All the way till um 2:00
20:22And the trend join long scanner again which uh the scanner is based off the results from the pre-market scan
20:30Then that's why that's why it needs to go 5 minutes after runs from 10:00 all the way to 2:30
20:39Okay
20:39Sweet
20:39So, and it also shows you all the files created and all that
20:41Um, okay
20:45Okay
20:45This is great
20:45By the way, if you're trying to learn more about integrating AI into your trading, then you should definitely attend my in real life master class this July in Toronto, Canada for Blossom Kong
20:57Blossom Kong is the ultimate conference series for retail investors who want to learn, connect, and grow in real life
21:05It's coming soon this summer in Toronto, Vancouver, and New York City
21:09If you're a retail investor, then check out the link down below, and I hope to meet you soon in real life
21:16So, I'm going to show you the results on my Telegram
21:18These are results that you're going to see each and every single morning
21:21So, at 8:30 a.m., you're going to see the pre-market gapper preview
21:24You'll see the tickers percentage, and the news catalyst
21:29Then after open, you know, I don't trade right after open
21:32After about 10 o'clock, that's when the strategy scanner will go
21:36That's when you'll see something like this called trend join long watch list
21:39And it's going to show you if there's any setups and any candidates available
21:44So essentially, you're going to see this every 30 minutes during the trading days
21:50You're going to see the gap list and the news briefing and then you're going to see the strategy scanner telling you if there's any candidates that fit the trend joint loan strategy
22:02Okay, now I'm going to walk you through how to set up Telegram notifications so you get these messages like the one I just showed you on my screenshot
22:09Now, along with the automation, I want all the runs, the results from both scanners after each scheduled run to be sent to my Telegram in this exact format
22:29Okay, so I just basically copy and pasted the format I have
22:31So you can see scanner A premarket gappers and then scanner B the trend join long hits
22:44So again you can copy this prompt on my blog but I want it exactly in this format otherwise it's going to be really messy
22:52So, after you put in that prompt, it's going to show you how to do that and I'll walk you through to I'm going to create new one on my um on my phone
23:04Okay
23:04So, it's going to So, basically just I just asked Claude and it's going to walk you through the Telegram process
23:11So, in Telegram, search for botfather and uh you're going to do all these
23:17Okay, I'm just going to do this right now
23:19So, go to bot father and I want a new bot
23:23New
23:23New bot
23:29I'm going to name it HTML 123
23:33Okay
23:33Now that we're done, I'm going to copy this token access
23:35I'm just going to give it to Claude
23:43So, once you have that from a Telegram, just give it to Claude
23:45Um, of course I'm blurring this for obvious reasons
23:51So, it's saving the token now
23:51Great
23:55And then it's gonna continue for you
23:57So, yeah, basically Cloud is going to walk you through everything and make sure at this time you start the bot
24:02So, I'm going to make sure I'm talking to the bot
24:07Okay
24:07Hello
24:07Start
24:07I need to make sure that I'm starting the bot
24:13Uh, I did press start
24:17Okay
24:20So, retry again
24:23Okay
24:23So, now you can see on my iPhone screenshot uh recording here
24:25This is the pre-market gappers
24:27Amazing
24:30Amazing
24:30Amazing
24:30I do see the gap list
24:36Now, also show me an example of the strategy scan result message on Telegram as well
24:46So, I wanted to run again as well
24:46So, again, this is just a sample
24:49Um, but the pre-market gappers is the first one we're going to see
24:54And then the strategy scanner is going to use is going to scan on all of these results since you should see a trend join long message in your bot chat with three sample hits
25:07Amazing
25:07Okay
25:07So, you can also see this too
25:11So, that's the strategy scanner
25:12Just to double check, the uh the telegram will be triggered as soon as there's new runs on the pre-market scanner and the strategy scanners as well, right throughout the entire day
25:29Amazing
25:29As you can see this on screen here is the wiring that we just created
25:36You get a pre-market scan, 12 fires a day, and you're going to get 12 Telegram messages
25:41If it has too much then you can obviously revise it on your own
25:45Then you get a trend joint long strategy runs as well
25:47Okay
25:47Like I mentioned earlier there's a bonus section to this video
25:53The trading view AI chart co-pilot the public beta is now available
25:59So they've been also on the DL on this
26:01I didn't even know about this until after I finished all the back testing and building all the back tester on Python
26:08So, they have this
26:08There's still some limitations, but I just want to show you what it can do
26:13It can actually make a lot of the back testing a lot easier
26:18So, give this article a a read
26:22Uh, and make sure you uh have the uh Chrome extension for the Trading Review Remix
26:27That's their AI model they're calling it
26:30So, make sure you have this
26:31And again, you still need to a paid subscription on Trading View once again
26:36Um so now let's go to our charts here
26:39Um so it can actually start back testing now
26:42So so remember earlier that claude and the trading view MCP connection they cannot do that many back testing but now with this I think you can back test a lot more
26:52So let me make sure I have the strategy loaded in
26:54I want you to run the back test on all the stocks in my watch list for the last 90 days on the 15 minute time frame using the current strategy that's loaded the demo TJL strategy
27:20All right, let's see if it works
27:24There you go
27:24Okay
27:33Oh, amazing
27:33First batch of six
27:37Okay
27:37So, you can see it's able to do it's showing that you I should have just bought and hold
27:42Yeah, you're probably right
27:43But again, we're using very limited samples
27:48So, I want to continue all the way
27:56All right, let's see what we got here
27:59The results
28:04So, I'm not sure why the same back test on Trading View itself
28:06Um, at least using the the Remix bot, it's not working, but as you can tell that it's it gives you a lot of options to optimize it
28:16So you guys can play around with it
28:18And I'm gonna I might do like a follow-up video on the Trading View remix as well
28:24The next thing I want to try to see if I can do is to give me the pre-market watch list, the gap scans
28:32Can you create pre-market gap scan of the top 10 gappers on the day with their ticker percentage change? Sorry, percentage gap pre-market by 8:30 a.m
28:48and any news catalyst that they may have
28:53The stock must be above $3 per share and pre-market must be trading at least 20,000 shares
29:03So the exact same criteria we did with claude in trading view earlier
29:06I want to see if this trading view AI can do the same
29:13Okay
29:13Yeah, you're correct
29:13There's no nothing on Sunday
29:16But oh, so it's able to give me all the list I asked for pre-market
29:20Amazing
29:20But I think the limitation is that it's not able to send it to my telegram
29:26Let's find out
29:29Are you able to send me that watch list every single morning to my telegram? So, let's find out
29:35I don't think I can
29:38Yeah, it's saying that we cannot do that
29:40We need to run the scan on demand every single morning, but maybe in the future you can run like external automations
29:50I think I'm going to keep playing around with this, but just so you know that a lot of the limitations we saw earlier with Claude um you can solve that within Trading View Remix, but again there's so there's always some other limitations like with this one you have to you cannot schedule it
30:05You have to run it on demand every single morning
30:09But it's definitely really cool to try out
30:11If you want me to make a follow-up video on the Trading View remix, especially, you know, with following up on the back testing I did earlier, let me know down below
30:20If you watch it this far, you'll know one thing
30:25Trading View Pine Script simply lets you back test
30:28It doesn't allow you to turn that Pine Script or indicator into an automated trading system
30:33But don't worry, I'm already on it
30:36I've already started trading this back tested strategy using interactive brokers API and these on screen are the results so far
30:47So, make sure to subscribe and turn on the notification bell because next week I'm going to post a video that'll walk you through the exact step-by-step process just like I did today
30:56Once again, the full blog with every single prompt and all the links and resources are linked down below
31:02Like I mentioned earlier, AI cannot make you profitable
31:08You, as the human, still needs to learn how to trade and still have a trading strategy
31:13So, make sure to watch this video to learn my two favorite trading strategies over