YouTube2Text

Gemini 3.5 + MCP = Algo Trading on Autopilot! — Transcript

by Algo-trading with Saleh · 3,041 words · 414 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Google just released Antigravity 2.0 and
  2. 0:03Gemini 2.5 flash model. And according to
  3. 0:05the benchmarks, it is blowing everyone's
  4. 0:08mind. Because even though it's a lot
  5. 0:09cheaper than expensive models such as
  6. 0:11Claude Sonnet or Opus, it's ahead in
  7. 0:13most of the benchmarks. But what I care
  8. 0:15is if I can use this model and this IDE,
  9. 0:18which is giving me free access to this
  10. 0:20model for doing real algo trading
  11. 0:22research. And I don't mean a tool that
  12. 0:24can control the browser like I did in
  13. 0:26the past, because that one was a bit
  14. 0:27slow. Instead, I want an MCP tool that
  15. 0:30can write the strategy, execute the
  16. 0:32backtest, look at the results, iterate
  17. 0:35over it until it can improve the
  18. 0:37results, give me a comparison of
  19. 0:39everything that it wrote before, and
  20. 0:41then complete report of what it did and
  21. 0:43then what worked. So, in other words, I
  22. 0:45just want a quant AI to do everything
  23. 0:47for me. So, maybe I can even run it 24/7
  24. 0:49to do algo trading for me and find as
  25. 0:52many strategies as possible. So, in this
  26. 0:54video, I'm going to show you the exact
  27. 0:55setup that can do that. Now, I got to
  28. 0:57say I am not a financial advisor and
  29. 0:59this video is for educational purposes
  30. 1:01only. So, with that out of the way,
  31. 1:02let's get right into the video.
  32. 1:05All right. So, you have two options. The
  33. 1:07first one is to use Antigravity as it
  34. 1:09is, which is no longer an IDE, it's just
  35. 1:12a desktop app, very similar to Codex or
  36. 1:14Cloud Code. The other option is to use
  37. 1:16Antigravity IDE, which is what we are
  38. 1:18already used to. It is the equivalent of
  39. 1:20Cursor by Google. In this video, I'm
  40. 1:22going to show you the IDE version, but
  41. 1:24the setup is very similar in
  42. 1:26Antigravity, Cloud Code, or whichever
  43. 1:28MCP tool that you're going to use. All
  44. 1:30right. So, here's the agent chat and
  45. 1:32here's the files of the project. And as
  46. 1:34always, I'm using Jesse framework for
  47. 1:36doing the algo trading stuff. Here we
  48. 1:38can see the models and now we have
  49. 1:39Gemini 2.5 flash, which is new. It has
  50. 1:43two modes, high and medium, and I think
  51. 1:45the medium is more than enough for our
  52. 1:46use case. All right. Now, I'm going to
  53. 1:48do the setup very quickly, but if you
  54. 1:49don't want to see it, feel free to skip
  55. 1:51ahead to the next chapter, because there
  56. 1:52are timestamps down below at the video.
  57. 1:54As you can see, we have a Jesse project
  58. 1:56here and this is the strategies folder
  59. 1:59and here we have the .env file of the
  60. 2:00project. Now, this is not a video about
  61. 2:03how to install Jesse. I have other
  62. 2:04videos about that, but there's one thing
  63. 2:06you need to notice and that is now we
  64. 2:08have this new environment value called
  65. 2:10MCP port and also MCP login terminal
  66. 2:13which by default is set to true. So, if
  67. 2:15you already have a Jesse project from
  68. 2:16before, feel free to add these new
  69. 2:18values. Next, we have this MCP rule file
  70. 2:21which is how we tell the model like
  71. 2:23where to look and what to do. And as the
  72. 2:25time goes, I'm going to update this file
  73. 2:27with new instructions. So, keep an eye
  74. 2:29for that. But right now, you don't
  75. 2:31really need to know this file or read
  76. 2:33it. You just need to add it in your
  77. 2:35conversations whenever you are using MCP
  78. 2:38with Jesse. And that is really easy. So,
  79. 2:40let's just say MCP rules. That's it.
  80. 2:42Now, I can just talk to the model and it
  81. 2:45will use these rules. The other way is
  82. 2:47to ensure it is attached to every new
  83. 2:50chat that you you open when you are in
  84. 2:52this project. And and for that, you can
  85. 2:54easily rename this file into
  86. 2:57agents
  87. 2:58.md.
  88. 3:00That's it. Now, when I open a new chat,
  89. 3:01it should be added by default. Like this
  90. 3:03is how almost every IDE is working these
  91. 3:06days. But just to be sure, I'm going to
  92. 3:08still attach it because I don't want to
  93. 3:11make a mistake in this video. All right,
  94. 3:13the next step is to run the project and
  95. 3:15connect the MCP into anti-gravity IDE.
  96. 3:18So, for that, we're going to have to
  97. 3:19open the terminal
  98. 3:20and simply first make sure to activate
  99. 3:24the correct conda environment. So, for
  100. 3:26me, it's called Jesse 3.12. And then I
  101. 3:29will simply say Jesse run. Now, let's
  102. 3:31make this a little bit bigger. All
  103. 3:33right, so you see here's the normal
  104. 3:35address for opening the dashboard of
  105. 3:37Jesse. So, let's click on this one
  106. 3:39first. All right, there we go. Now, the
  107. 3:41first time you do this, you're going to
  108. 3:42be prompted for a password and by
  109. 3:44default, it is set to test. And the
  110. 3:47other value that I care for is this one
  111. 3:49which is the address for the MCP. So,
  112. 3:51you see it has the port 9007, but this
  113. 3:54is because on my machine I have edited
  114. 3:56the .env file with different ports. But,
  115. 3:59when you do, this is going to be 9000,
  116. 4:019001, 9002. So, I have changed them. So,
  117. 4:04in case you also change them like me,
  118. 4:06just keep an eye for that. So, for me,
  119. 4:09again, this is going to be the address
  120. 4:10for the MCP. So, let's copy this. Now,
  121. 4:14we're going to need to add it to our
  122. 4:15IDE. For that, I'm going to click here,
  123. 4:18and then the MCP servers,
  124. 4:21then the manage MCP servers.
  125. 4:24And in this file, for some reason, it is
  126. 4:26not showing me anything, but it is ready
  127. 4:28to get me to this server. Now, I'm going
  128. 4:30to click on view raw config. And here,
  129. 4:33you can see some examples from the IDE
  130. 4:35itself. So, let's zoom out a little bit
  131. 4:37so I can copy this. And by the way,
  132. 4:38there are two configurations we can use.
  133. 4:40The first one is for local MCP, the
  134. 4:42second one is for remote. And the remote
  135. 4:44is the one that we want. Yes, the MCP of
  136. 4:47Jesse is served locally on your local
  137. 4:50host, but still, when adding it needs to
  138. 4:53say the remote option, because that's
  139. 4:54the one that uses the HTTP. So, there's
  140. 4:57another kind of MCP that we are not
  141. 4:59concerned in this setup. So, let's copy
  142. 5:01this, close this, zoom in again, sorry.
  143. 5:04All right, so let's paste it in. Let's
  144. 5:06close this. All right, so here,
  145. 5:09actually, the auto complete was just
  146. 5:11crazy helpful.
  147. 5:13And again here. So, okay, so I am
  148. 5:16impressed. So, let's just rename this
  149. 5:19into Jesse MCP. This could be any name,
  150. 5:23by the way. This address is the one that
  151. 5:25we care for, and these headers can also
  152. 5:28be just empty. Okay, so there we go. All
  153. 5:32right, now we should have these MCP
  154. 5:34servers.
  155. 5:35Let's click on refresh, and there we go.
  156. 5:38Now, we can see Jesse MCP, and it is
  157. 5:40indeed enabled. All right, so let's
  158. 5:42close this window, and go back to the
  159. 5:45chat interface. And here again, we have
  160. 5:47selected Gemini 2.5 flash. Let's open
  161. 5:51these files one more time. All right,
  162. 5:52now that setup is done, we are ready to
  163. 5:54ask the agent to do some actual research
  164. 5:57for us. All right, I have ensured that
  165. 5:58the agent's MD file is attached, even
  166. 6:00though I probably don't need to do that
  167. 6:02because all the IDs attached that by
  168. 6:04default. And the prompt is, "Please
  169. 6:06create a new strategy named golden cross
  170. 6:08strategy, and it should be trend
  171. 6:10following. You should trade it on the
  172. 6:12BTC USDT on Binance perpetual futures
  173. 6:15for 2024 using the 4-hour time frame."
  174. 6:18Let's hit enter and just watch the magic
  175. 6:21happen. As you can see, it started using
  176. 6:23the MCP.
  177. 6:26I'll say, "Yes, always use it." Yes,
  178. 6:28always use it. Okay, so it's being a
  179. 6:30little bit annoying by asking every
  180. 6:32single time, but I'm guessing this is
  181. 6:33just for the first time that it tries to
  182. 6:36use any sort of tool. Let's make this a
  183. 6:39little bit bigger.
  184. 6:42All right, I looked it up and I couldn't
  185. 6:43find any settings for to ensure that it
  186. 6:46just uses the MCP without keeping to ask
  187. 6:50for permissions. This is a bit annoying.
  188. 6:52I might be missing something, so if you
  189. 6:53guys know where that setting is, please
  190. 6:54leave it down in the comments. I really
  191. 6:56want to know that.
  192. 6:58All right, there we go. So, it created a
  193. 7:00report file to tell me exactly what it
  194. 7:03did, and of course the strategy code
  195. 7:05itself. So, let's take a look at the
  196. 7:06code of the strategy first. Let's
  197. 7:08minimize this. All right, so here's the
  198. 7:10strategy. It defined a fast SMA, a slow
  199. 7:13SMA, the ATR, and here's the entry rule
  200. 7:16of the strategy, like whether it should
  201. 7:17go long or not. And it's saying that
  202. 7:19whenever the crossover happens, then you
  203. 7:22want to go long. Whenever the opposite
  204. 7:24happens, you want to open a short
  205. 7:26position. It's using 10% of the balance
  206. 7:29for the position sizing. It is
  207. 7:31submitting the buy order, the stop loss
  208. 7:33and take profit. And for those, it is
  209. 7:35using the ATR indicator, so the stop
  210. 7:37loss is two times of the current ATR,
  211. 7:40and the take profit is four times, so we
  212. 7:41have a win to loss ratio of two. The
  213. 7:44opposite is for short positions, and
  214. 7:46then it is saying that whenever the
  215. 7:48golden cross is no longer valid, we want
  216. 7:51to liquidate the current position. So,
  217. 7:52this is perfect code, and it seems like
  218. 7:55it actually ran the code, and it is
  219. 7:57giving us some report. So, let's accept
  220. 7:59this and then read give it a read. So,
  221. 8:00it designed a trend following strategy
  222. 8:02based on these criterias. It verified
  223. 8:05that we have enough historical candles
  224. 8:07in the database, and then it's ran the
  225. 8:09backtest. The win rate was 52%. The max
  226. 8:12drawdown was 1.57.
  227. 8:14The Sharpe ratio was 0.68. So, these are
  228. 8:17all good, and here's the conclusion of
  229. 8:19it. It's also recommending some next
  230. 8:22steps. So, here's what I'm going to do.
  231. 8:24Let's open it one more time and say, "I
  232. 8:27need you to add three more iterations to
  233. 8:29the strategy. Try to improve the
  234. 8:31results, and at the end give me a
  235. 8:33comparison of the results and select the
  236. 8:35best one." Now, while that's going, I
  237. 8:37want to quickly remind you guys about
  238. 8:39our Telegram. It's the fastest way to
  239. 8:40get notified about my future work,
  240. 8:42whether it's a new tutorial or a tool
  241. 8:44that I create. Also, don't forget to
  242. 8:46check out our free Discord, where more
  243. 8:47than 5,000 members like you and I are
  244. 8:50hanging out there and helping out each
  245. 8:51other with algo trading, so we can all
  246. 8:53succeed together. The links for both are
  247. 8:55down in the description.
  248. 8:57So, let's hit enter. And while this is
  249. 9:00going, I'm going to open the dashboard
  250. 9:02of Jesse, so we can actually see the
  251. 9:04backtest that it just executed. So,
  252. 9:06let's go to history, and here is the one
  253. 9:09that it just defined right now. So, if I
  254. 9:11go here, here we can see the equity
  255. 9:13chart for it. Here's the scale version
  256. 9:16of it. Now, the net profit is so low
  257. 9:19because it's using only 10% of the
  258. 9:21capital for entering the position, which
  259. 9:24is not really a good option, but the win
  260. 9:26rate is good. The Sharpe ratio is not
  261. 9:28that bad, which means we can easily
  262. 9:29increase the size of the position to get
  263. 9:31better results. In fact, we're going to
  264. 9:32do that just in a second. But, yeah, so
  265. 9:34far this looks okay. We also have the
  266. 9:37other charts. Okay, so this is pretty
  267. 9:39cool. Let's go back to it. Another
  268. 9:41annoying permission asking. Now, another
  269. 9:43thing that I think needs some update is
  270. 9:45that you see whatever it does is this is
  271. 9:48printing out the outputs and the inputs.
  272. 9:50Like this isn't super cool. When I use
  273. 9:52the MCP in other IDEs or tools such as
  274. 9:54Cloud Code, it doesn't show me these
  275. 9:56things unless I actually want to see
  276. 9:58them and I click on them. So, I think
  277. 10:00this also needs some updating. I think
  278. 10:03there must be some sort of settings for
  279. 10:05it to improve this, but I want to just
  280. 10:07point out that these days I'm not using
  281. 10:09anti-gravity. It just came out, but the
  282. 10:12fact that it's giving us this amount of
  283. 10:15tools all for free is just super cool.
  284. 10:17All right, so it is done and it just
  285. 10:20gave us a beautiful table comparing all
  286. 10:23the iterations. So, this is the
  287. 10:24iteration number one up until iteration
  288. 10:26number four. Here's the strategy setup
  289. 10:29like which parameters and indicators it
  290. 10:31was using and here here we can see the
  291. 10:34ending balance. So, clearly the
  292. 10:36iteration two is the best one, the sharp
  293. 10:38ratio of 1.76. So, yeah, this one is
  294. 10:40just super great. Here's the number of
  295. 10:42total trades, the win rates, profit
  296. 10:44factor, and it's also like explaining
  297. 10:47what exactly was used and how effective
  298. 10:49it was. And then it says that based on
  299. 10:52the empirical evidence, iteration two is
  300. 10:54the clear and superior winner and I have
  301. 10:56restored the active code in the init
  302. 10:59file to the iteration number two
  303. 11:01implementation. And it also updated this
  304. 11:04report file that it just creates for us,
  305. 11:06which is really beautiful to just read.
  306. 11:08I can also see the same table to compare
  307. 11:12the results. Now, this is in markdown
  308. 11:13format, so we need to enable the preview
  309. 11:16in in case you want to just read it
  310. 11:18right here. Okay, there we go. So, yeah,
  311. 11:21it gave us a report for iteration number
  312. 11:23one, iteration number two, and three.
  313. 11:25And there's also a table comparing
  314. 11:27everything together. So, you don't even
  315. 11:29need to read everything here. If you
  316. 11:31miss this or whatever in the future, you
  317. 11:33can just come back here and read the
  318. 11:35report that it just wrote for you. And
  319. 11:37now if I go back to Jesse's dashboard,
  320. 11:39go to the history page, I can also find
  321. 11:42this session right here. And here you
  322. 11:44can see that it's the equity curve was
  323. 11:46better. You know what? Let's ask the
  324. 11:47model to include the size of the
  325. 11:48position so that we can actually see
  326. 11:50this equity curve cuz this isn't really
  327. 11:51great.
  328. 11:52Increase the size of the position in a
  329. 11:54way that the max drawdown won't be no
  330. 11:57worse than minus 20%. Okay, so this is
  331. 12:00really cool. Like I don't even need to
  332. 12:01touch the code anymore. And
  333. 12:04this is very different than a normal
  334. 12:05changing, right? Because now this MCP it
  335. 12:08has access to the documentation of
  336. 12:10Jesse. So it's different than the way
  337. 12:13that you usually change the code in a
  338. 12:15Jesse project because then it the model
  339. 12:17might make a mistake. It tries to guess
  340. 12:19like the indicator problems or things
  341. 12:21like that. But now it has clear access
  342. 12:23to the documentation. And whenever it
  343. 12:26makes a change, it actually runs the
  344. 12:28code to ensure that it works. Now,
  345. 12:30here's the fun part.
  346. 12:31We just ran out of the free credit. So
  347. 12:35this is also a good
  348. 12:36demonstration of like how much limits
  349. 12:39you actually have because guys, I
  350. 12:41started using this thing just when I
  351. 12:43started the video. I mean I did test it
  352. 12:45in other IDs, but with this ID this is
  353. 12:47the first time I tried it. So we can
  354. 12:48clearly see how much free credits are
  355. 12:51given to us. Now, for the remaining of
  356. 12:53the video, I'm going to do the edits by
  357. 12:56my own hands. So let's just come here
  358. 12:59and Okay, it seems like it actually did
  359. 13:01make changes because it's showing that
  360. 13:03it is now using two times of the current
  361. 13:05balance, which is good. In other words,
  362. 13:07it's going to use some leverage, which
  363. 13:09is perfectly fine because the max
  364. 13:11drawdown of the strategy wasn't high in
  365. 13:13the first place. So let's just open the
  366. 13:14dashboard one more time and run it.
  367. 13:18And there we go. So now we can see the
  368. 13:20equity curve. It is now producing 73% in
  369. 13:23profit. Max drawdown is minus 18%, which
  370. 13:25is exactly what I asked the model to do
  371. 13:27and the Sharpe ratio is 1.75.
  372. 13:30The drawdown periods are just fine and
  373. 13:32here are also the monthly returns heat
  374. 13:34map where we can see like how much the
  375. 13:37strategy made in every single month.
  376. 13:39Now, obviously I just over simplified
  377. 13:40everything and I'm not going to trade
  378. 13:42this strategy just yet. In reality
  379. 13:44you're going to want to pay for a plan
  380. 13:46in order to be able to run these
  381. 13:48research sessions for longer periods of
  382. 13:51time because you want the model to keep
  383. 13:53writing and modifying the strategy until
  384. 13:55it finds the best ones. The other thing
  385. 13:57is that right now I just use it to write
  386. 13:59the strategy and the backtest and just
  387. 14:01compare the results and give me the best
  388. 14:02one. But this is just the beginning of
  389. 14:04the MCP integration for Jesse. Now
  390. 14:06imagine if you could ask the model to
  391. 14:08run optimizations to find the best
  392. 14:09parameters and then it could maybe run
  393. 14:11Monte Carlo simulations on it to ensure
  394. 14:14that the results that it is giving you
  395. 14:16is not overfit. Like that's going to be
  396. 14:17a complete quant which is ready to do
  397. 14:20research for you like 24/7. So I
  398. 14:22couldn't be more excited about the setup
  399. 14:24and the future of this for it. And even
  400. 14:26though the limits for the free plan
  401. 14:27wasn't like that much, it still I am
  402. 14:29thankful to Google for giving us this
  403. 14:31tool for free. Now before I leave you
  404. 14:32we're going to have a giveaway. A random
  405. 14:34subscriber who likes the video and posts
  406. 14:36a comment is going to win 1 million BONK
  407. 14:38token. All right, let's pick the winner
  408. 14:39from the previous video.
  409. 14:43And the winner is need more videos like
  410. 14:45this, very helpful. Thank you so much
  411. 14:46for your comment. Please reach out to me
  412. 14:48so I can send you your BONK tokens.
  413. 14:49Thank you so much for watching. I'll see
  414. 14:51you in the next one.

About this transcript

This page contains the full transcript of Gemini 3.5 + MCP = Algo Trading on Autopilot! by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 3,041 words across 414 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.