YouTube2Text

Grok 4 tested: Is it good for algo-trading strategies? — Transcript

by Algo-trading with Saleh · 5,341 words · 751 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hey guys, it's so XAI or the team behind
  2. 0:02the Gro model or as they are usually
  3. 0:04called Elon Musk just released Grock 4
  4. 0:07model. As always with everything Elon
  5. 0:09Musk, there's a lot of hype behind this.
  6. 0:12So in this video, what I want to
  7. 0:14particularly test is how good this model
  8. 0:16is for algo trade. So that means tasks
  9. 0:19such as writing strategies or debugging
  10. 0:21them or coming up with new trading
  11. 0:24ideas. So if that all sounds interesting
  12. 0:25to you, let's get right into it. Now
  13. 0:27this is the official benchmark released
  14. 0:29by their team. And if you take a look at
  15. 0:31the LCB which is stands for live coding
  16. 0:33benchmark which is the one we care for
  17. 0:36this task shows that Gro 4 without any
  18. 0:39tools of course because if it is using
  19. 0:41tools we don't know which type of tools
  20. 0:43it is using and we're definitely not
  21. 0:45using it here. So this is the one we
  22. 0:48care about and also this is the one that
  23. 0:50all the other models have such as 03 and
  24. 0:52Gemini 2.5. So it is showing significant
  25. 0:56improvements compared to at least Gemini
  26. 0:582.5 Pro. Now notice that they are not
  27. 1:00comparing it to Cloud Sonnet 4 and I
  28. 1:04think that's intentional because at
  29. 1:06least to my opinion cloth set is still
  30. 1:09the king of LLM models at least for
  31. 1:11Cody. But anyway, so it sounds like it's
  32. 1:13really good but I found it to be a bit
  33. 1:15more expensive than even Cloud Sonnet.
  34. 1:18So what I really want to see is if it
  35. 1:20actually blows me out of the water. So
  36. 1:22anyways, I updated our Jesse GPT to have
  37. 1:25the Grock for model and as you can see
  38. 1:28it is indeed more expensive than all the
  39. 1:30other models. Now if you don't want to
  40. 1:32use Jess GPT for either privacy concerns
  41. 1:35or if you don't want to pay us anything
  42. 1:37that's perfectly fine. You can watch
  43. 1:39this video of mine where I show you how
  44. 1:42you can self-host this thing by yourself
  45. 1:44because remember we want to test it for
  46. 1:46Algo trading and the instructions that
  47. 1:48I'm feeding the model are specifically
  48. 1:50for this use case. So either use JGPT as
  49. 1:54I am in this video or go with the
  50. 1:56self-hosted solution. In the previous
  51. 1:58video where I tested the cloud 4 model,
  52. 2:00we use a pass or fail ranking model. But
  53. 2:03in your comments, you guys suggested for
  54. 2:05me to use a number based model. So in
  55. 2:08this video, we're going to rank every
  56. 2:10task that the model does from 0 to 10.
  57. 2:13And in the end, we're going to end up
  58. 2:14with a total score. All right. So let's
  59. 2:16begin with the hello world question of
  60. 2:17algo trading. Write a golden cross
  61. 2:19strategy that uses the 50 and 100 moving
  62. 2:22averages. Close the position when the
  63. 2:24inter rule is no longer valid. It took a
  64. 2:27long time for the model to finish this
  65. 2:29question. I'm guessing this is because
  66. 2:31since they just launched the model,
  67. 2:33maybe their API is under heavy traffic.
  68. 2:36But anyways, so this seems perfectly
  69. 2:40fine. It defined a moving average with a
  70. 2:42period of 50 and 100 passes current
  71. 2:46candles is perfectly correct. It defined
  72. 2:49a trend property. It returns one for
  73. 2:52uptrend and minus one for a downtrend.
  74. 2:55Then in the shoot long it's asking
  75. 2:57whether or not the current trend equals
  76. 2:58one or an uptrend. In other words, it is
  77. 3:01not shorting which is fine because I
  78. 3:02didn't ask for it. It also defined this
  79. 3:05one which it didn't really have to. And
  80. 3:08when the current turn equals minus1, it
  81. 3:10is liquidating the current position,
  82. 3:12which is exactly what I asked it to do.
  83. 3:14And it is also very briefly explaining
  84. 3:16what it did. So I like this answer.
  85. 3:19Let's copy it. Go to Jesse and create a
  86. 3:22new strategy. Now I'm going to call it
  87. 3:24test rock 4.
  88. 3:28Let's paste it here. Go to back test.
  89. 3:32Let's close these.
  90. 3:36And I'm going to define
  91. 3:39the duration of it since the beginning
  92. 3:41of this year.
  93. 3:43Pick BTC UCT and choose the hourly time
  94. 3:49frame because I don't really care about
  95. 3:50the metrics of this strategy right now.
  96. 3:52So I'm not going to test all the time
  97. 3:54frames. I just want to see if it runs
  98. 3:55well. And let's pick test Gro 4. Now the
  99. 4:00fast mode should be on. Let's run it.
  100. 4:06and it runs just fine.
  101. 4:09They executed 25 trades.
  102. 4:12It didn't make a profit.
  103. 4:15The max thon is minus 36. The win rate
  104. 4:18is 28%. All right. So, this is fine. And
  105. 4:21I'm going to give it a perfect 10. Next,
  106. 4:25convert this pine script strategy into
  107. 4:27Python code. Now, I need a pine script
  108. 4:29code to feed the model. So I'm going to
  109. 4:32look up a strategy called super trend on
  110. 4:35trading view and it is this one super
  111. 4:38trend strategy
  112. 4:43and here are the supposedly results of
  113. 4:46its back test. Now to get the code I'm
  114. 4:49going to click here and this is the pine
  115. 4:53script that I'm looking for.
  116. 4:55So let's go back
  117. 4:57and do this.
  118. 5:02Now, unfortunately, no matter how many
  119. 5:04times I tried this question, it just
  120. 5:06doesn't work and it doesn't give me any
  121. 5:08answer. I'm not sure why that's the case
  122. 5:10because I tried it with Gro 3, the
  123. 5:13previous version of them and it works
  124. 5:14fine or with any other model on Jess
  125. 5:17GPT, but for this question, it's not.
  126. 5:20So, unfortunately, I have no choice but
  127. 5:23to give them zero for this question.
  128. 5:26Next, develop a mean diversion strategy
  129. 5:28using the Ballinger bands and the RSI
  130. 5:30with a seven period.
  131. 5:34All right. So, here it is. It didn't do
  132. 5:36syntax highlighting. That's because of
  133. 5:38this extra py that you see here. So,
  134. 5:40that's fine. Let's copy it. Go back and
  135. 5:44paste the code here. And also make sure
  136. 5:47to remove this extra py. Now, let's take
  137. 5:49a look. It defined the Ballinger bands.
  138. 5:52It named it BB, which is fine. define
  139. 5:53the RSI with the correct syntax and also
  140. 5:56the period of seven. In the shelong,
  141. 5:58which is the interior rules of the
  142. 5:59strategy, it's saying if the closing
  143. 6:01price is below the lower band and the
  144. 6:05current RSI value is also below 30.
  145. 6:08That's perfectly correct. It did the
  146. 6:11opposite for short positions. It's
  147. 6:13returning true for shoot cancel entry
  148. 6:16which is only helpful if we are using a
  149. 6:18limit order or a suborder to enter the
  150. 6:21positions which we are not because here
  151. 6:23you see we are using the current price
  152. 6:26which causes Jesse to submit a market
  153. 6:28order. Now here it's using size to
  154. 6:30quantity and passing the entire
  155. 6:32available margin. That's perfectly fine.
  156. 6:35And in the update position which only
  157. 6:37gets called after a position is already
  158. 6:40open. It's saying if it's a long
  159. 6:41position but the current closing price
  160. 6:44is above the middle band, I want to
  161. 6:46liquidate the position and for a short
  162. 6:48position do the other way around. That's
  163. 6:51perfectly correct. So let's go back and
  164. 6:54run a back test.
  165. 6:57And it runs perfectly fine. Actually,
  166. 7:00did I save it?
  167. 7:04No, sorry. I didn't save the code. So by
  168. 7:07pressing command S or this button we can
  169. 7:10save it. So let's go back and run it one
  170. 7:12more time
  171. 7:14and we're getting an error. Okay, now
  172. 7:16this is fine. It's because of that extra
  173. 7:18py. I forgot to remove it this time. All
  174. 7:22right. So one last time
  175. 7:26and it goes through. All right. So this
  176. 7:28is fine. It executed
  177. 7:31155 trades
  178. 7:33and yet it didn't lose that much.
  179. 7:35Actually, I think this strategy has some
  180. 7:38good potential in it. The win rate is
  181. 7:4063%. I like this. I might actually work
  182. 7:43on this later. So, we're going to give
  183. 7:45it a perfect 10. All right. Next, write
  184. 7:48a strategy that uses Fibonacci
  185. 7:50retracement levels for entry and exit
  186. 7:52points. So, this is a tough one. All
  187. 7:55right. After a lot of time, it finally
  188. 7:58printed out the result. So, let's copy
  189. 8:00it. Go to Jesse, edit the code, and
  190. 8:04paste it here and save it before I
  191. 8:06forget. Now, it named it fib
  192. 8:09retracement. It defined swing period as
  193. 8:1250. This is the look back period for
  194. 8:15swing high or low, which is indeed
  195. 8:17needed. The swing high is saying MP.max.
  196. 8:22to current candles. It's only selecting
  197. 8:24the swing period which again is the look
  198. 8:26back period. Now I think a better name
  199. 8:28for this would have been just look back
  200. 8:30period but anyways so it is selecting
  201. 8:35the index of three. Now in Jesse the
  202. 8:37indexes of candles goes zero for time
  203. 8:40stamp then one for open two for close
  204. 8:43three for high four for low and five for
  205. 8:46volume. So three for high is correct and
  206. 8:50four for low is also correct. Now the
  207. 8:52fib levels this is the important one.
  208. 8:54It's saying that diff equals swing high
  209. 8:56minus swing low and it define the three
  210. 8:58levels as swing low plus the difference
  211. 9:03multiplied by this Fibonacci number and
  212. 9:07then this one and this one. Okay, this
  213. 9:09is not only true but I kind of like how
  214. 9:11it wrote it. It's very simple and
  215. 9:13practical. Now then we defined an EMA
  216. 9:17fast with a period of 50. Another one
  217. 9:19with a period of 200 for slow. The
  218. 9:22uptrend is when the EMA fast is above
  219. 9:24EMA slow. The downtrend is the opposite
  220. 9:27of that. And for shoot it's saying f me
  221. 9:30the Fibonacci level of 61.8
  222. 9:34the previous close and it's saying if
  223. 9:37it's an uptrend and the previous close
  224. 9:39is below this Fibonacci while the
  225. 9:42current close is above it. Right? It's
  226. 9:44trying to detect whether or not we have
  227. 9:46just crossed it. Then we want to go
  228. 9:49long, right? So let's draw the Fibonacci
  229. 9:52line over a chart. Now here's the 0.5
  230. 9:57line. Here's 0382
  231. 10:02and this is 0.618.
  232. 10:04Now it's saying that whenever the price
  233. 10:06crosses this line like in this case, we
  234. 10:09want to go long. So it's some kind of a
  235. 10:13breakout strategy. It's not a mean
  236. 10:15reversion. All right? So we're not
  237. 10:17trying to open a long position when the
  238. 10:19price is here, for example. Instead, we
  239. 10:21wanted to cross this line. So it is
  240. 10:23technically correct, I guess, but it's
  241. 10:25not how I'm used to Fibonacci. It's
  242. 10:28perfectly fine, though. All right. So
  243. 10:29let's see how it's opening the position.
  244. 10:31It's using market order.
  245. 10:33And here you can see the entry is the
  246. 10:35current price. The stop loss is set at
  247. 10:38the Fential line of 38 which is this
  248. 10:42line. For quantity, it is risking 3% of
  249. 10:45the entire account.
  250. 10:47And for a short position, it's doing the
  251. 10:49opposite. Now, when we open the
  252. 10:51position, we are submitting the take
  253. 10:53profit and we're using the TP level of
  254. 10:56this. So if it's a long position, it's
  255. 10:59saying I want the swing high plus the
  256. 11:03difference between swing high and the
  257. 11:05swing low multiplied by this. So again,
  258. 11:09this is really interesting. It's not
  259. 11:11using the typical Fibonacci levels for
  260. 11:14exiting the trade. It's basically
  261. 11:17expecting the price to continue to go up
  262. 11:19again because it's supposed to be a
  263. 11:21breakout strategy according to the
  264. 11:23model. But even for that, it is using
  265. 11:26the Fibonacci lines because it believes
  266. 11:28these are magic numbers. So this is
  267. 11:31certainly interesting. But again, this
  268. 11:33isn't how I'm used to Fibonacci. So I
  269. 11:36don't know. Let's run and see if it
  270. 11:38gives us maybe good results. But I know
  271. 11:41one thing. It is not submitting the
  272. 11:43stops here. If it had submitted the
  273. 11:47surplus here, it would have been fine.
  274. 11:49But it's not. It is defining the sub
  275. 11:50price but it didn't do something like
  276. 11:53this. I mean if it did it like this
  277. 11:57surplus it would have been fine. So
  278. 12:00because in Jesse you don't have to
  279. 12:02define the surplus inside the unopen
  280. 12:04position. You could also do it here but
  281. 12:07that only works if it's a futures
  282. 12:09account. If it's a spot you cannot do
  283. 12:11that but it's not doing that. instead
  284. 12:14inside the update position is saying
  285. 12:16that
  286. 12:18if it's a long position and we're not in
  287. 12:19upturn anymore liquid the current
  288. 12:21position so basically we are not
  289. 12:23submitting a stop loss I don't love that
  290. 12:26to be honest especially because it did
  291. 12:28calculate the stop loss here it should
  292. 12:30have submitted it here so that's at
  293. 12:31least one mistake
  294. 12:34so let's go to the back test and run it
  295. 12:36and see if it goes through all right so
  296. 12:38here's the result
  297. 12:41it runs fine there is also aren't great.
  298. 12:45Let's also try it with another time
  299. 12:47frame at least because I'm curious.
  300. 12:51All right, so with the 4 hours, it's
  301. 12:53actually doing really well. So the draw
  302. 12:55down is good. This is a good P&L. The
  303. 12:58win rate is really high and the sharp is
  304. 13:012.3. So I really like this. So you know
  305. 13:04what? Let's also back test it for one
  306. 13:06year earlier
  307. 13:10because I'm really curious about this
  308. 13:11one.
  309. 13:14All right. So,
  310. 13:17it is losing here, but starting here, it
  311. 13:21just went up and up.
  312. 13:24So, this is actually good. Like even in
  313. 13:26here, it didn't do that bad. So, I think
  314. 13:30this strategy has some good potential in
  315. 13:32it. So, I'm going to give it a nine out
  316. 13:35of 10. I will subtract one because based
  317. 13:38on how it calculated the stops itself,
  318. 13:41it should have also submitted the order
  319. 13:43but it didn't. All right. Next, I'm
  320. 13:45going to ask it to update my code to
  321. 13:47display the values of important
  322. 13:48indicators of my strategy in back tests
  323. 13:51for debugging purposes. So, this is a
  324. 13:54typical task that I use AI every day
  325. 13:56because I'm a bit lazy and I don't want
  326. 13:58to do it manually. Now, for this one, we
  327. 14:01need a code of a strategy. And I'm going
  328. 14:02to use this strategy which I submitted
  329. 14:05just a few days ago. If you haven't
  330. 14:07watched the video for it, go and check
  331. 14:09it out. So, here it is. Let's do this
  332. 14:13and actually we already had the
  333. 14:16indicator values. So, let's remove it
  334. 14:19and
  335. 14:21hit enter.
  336. 14:23All right. So, let's copy the whole
  337. 14:25thing.
  338. 14:30Go back, update the code, paste it here,
  339. 14:32and save it. And this is how it did it.
  340. 14:35Add line to candle chart for tema 10 and
  341. 14:3980. It created a new extra line chart
  342. 14:42for the long-term values, which used
  343. 14:464our time frame.
  344. 14:48It added a new one for ADX, a new one
  345. 14:51for CMO, and
  346. 14:54it also added one just for the trend
  347. 14:56lines. So, it's a bit too much, but it
  348. 14:59should run just fine. So, let's go back,
  349. 15:02bring this back to the beginning of
  350. 15:052025, and run it again.
  351. 15:10And here it is. So, it executed nine
  352. 15:13trades.
  353. 15:16All right. So, let's go back and make
  354. 15:18sure the back test duration is since the
  355. 15:20beginning of turn 25. And also, let's
  356. 15:23make sure the interactive charts option
  357. 15:25is enabled. And now let's run it.
  358. 15:29Here it is. And if I open this option.
  359. 15:33All right. Now we have so many charts
  360. 15:35that it doesn't allow us to see our
  361. 15:37candles chart. Now that's not great,
  362. 15:40but there is a fix for it. So let's
  363. 15:43first take a look at these numbers. So
  364. 15:46for the long-term tema, it looks
  365. 15:49perfectly fine.
  366. 15:51The ADX is also fine. It's an isolator
  367. 15:56between zero and 100. The seam all also
  368. 15:59looks perfectly fine. It also defined
  369. 16:02the thresholds for upper and lower at 40
  370. 16:05and minus 40. It also did a fine job for
  371. 16:08the trend. But here's the thing. I don't
  372. 16:10think it should have defined the values
  373. 16:12of tea 70 and 20 in another chart. It
  374. 16:16should have simply added it to the main
  375. 16:18candle chart which we cannot see here.
  376. 16:20So let's close this.
  377. 16:24go back and edit it.
  378. 16:27Now, you see here, it shouldn't have
  379. 16:29done this, but I'm just going to disable
  380. 16:31it because
  381. 16:33I want to lower the number of charts.
  382. 16:35So, let's disable these two. Go back and
  383. 16:38run it again.
  384. 16:41Now, we can actually see the candles
  385. 16:44chart and also where we bought and where
  386. 16:47we sold. Of course, we can also check
  387. 16:49out the trades. For example, we can see
  388. 16:53the orders of this trade which caused us
  389. 16:57to lose. So, we shorted but the price
  390. 17:00went up. And here we can see that the
  391. 17:03ADX was indeed above the threshold and
  392. 17:06everything was according to the strategy
  393. 17:08but still it lost money. And we can also
  394. 17:11see that the tema 10 and 80 are added to
  395. 17:14this chart which makes it really easy
  396. 17:16for us to see. So, this is good, but it
  397. 17:19didn't do a perfect job. Like, I didn't
  398. 17:22like that it added one new chart just
  399. 17:25for a value that it could have easily
  400. 17:28added here. But I don't want to be too
  401. 17:30harsh on it. So, I'm going to give it
  402. 17:31nine. Next, write a trend following
  403. 17:33strategy that uses 50 minutes time frame
  404. 17:36for entry and 4 hours time frame for
  405. 17:39confirmation.
  406. 17:40All right. So, let's copy the whole
  407. 17:42thing.
  408. 17:44Go back to Jesse and edit the code.
  409. 17:47Paste it here. Now, let's take a look.
  410. 17:51It's supposed to be a trend following
  411. 17:53strategy that uses the 15 minutes time
  412. 17:55frame. Now, this one depends on our pick
  413. 17:57of the time frame when running the back
  414. 17:59test. But as for the 4 hours, it's
  415. 18:02defining the candles 4 hours. It's using
  416. 18:04the get candles and it's specifying the
  417. 18:08time frame as 4 hours. That's correct.
  418. 18:11It defined the EMA of 50 using that for
  419. 18:14hours again like this. Now I like this
  420. 18:17syntax that it first defined a property
  421. 18:20which makes it easy to access here
  422. 18:22instead of selecting the candles one
  423. 18:24more time in here. It did it again here
  424. 18:27for the trend. It's saying if the last
  425. 18:29value of this now we usually don't do
  426. 18:31this in Jessie because we can simply
  427. 18:33write it as this. Right? We don't need
  428. 18:35this. But because it passed the
  429. 18:37sequential as true it did have to do
  430. 18:39this. Now I don't approve of this. It's
  431. 18:42not as readable as I like it to be. But
  432. 18:44it's correct and it should go just fine.
  433. 18:46For an uptrend is it is returning one.
  434. 18:48For a downtrend it's returning minus one
  435. 18:51and zero for neutral. Then need to find
  436. 18:53the MACD like this. And in should long
  437. 18:56it's saying that if the last value of
  438. 18:58MACD is bigger than the last value of
  439. 19:00MACD signal and if the trend is one, it
  440. 19:04should go long. It's doing the opposite
  441. 19:06for short trend. All right. So it seems
  442. 19:08fine. And for the stop loss, it's saying
  443. 19:10the entry minus two times of the ATR.
  444. 19:12This is also perfectly correct. So
  445. 19:14everything seems fine. But again, I
  446. 19:16don't love it that it did here because
  447. 19:18unless you specifically need the
  448. 19:20previous values, never use the
  449. 19:23sequential value. It just makes your
  450. 19:24code a little bit more complex and
  451. 19:27harder to read. All right, let's run it.
  452. 19:31And here it is. All right, so it runs
  453. 19:33just fine. We executed 21 trades. Oh, we
  454. 19:37forgot to set the time frame to 15
  455. 19:39minutes. So, if I run it again and this
  456. 19:42time we should get an error saying that
  457. 19:44we are missing the 4 hours time frame
  458. 19:45because I didn't specify it. But since
  459. 19:48this is back, Jess is smart enough to
  460. 19:51take care of it for us. But if you are
  461. 19:53trading a strategy like this in a live
  462. 19:55trading mode, you have to also define
  463. 19:58the data route for it, which is like
  464. 20:00this. So the same symbol except that the
  465. 20:03time frame is now 4 hours instead of 15
  466. 20:05minutes. Now if I run this one, I
  467. 20:08shouldn't get any errors.
  468. 20:11All right. So it's fine that it's losing
  469. 20:13money because I found scalping
  470. 20:14strategies to lose money unless if you
  471. 20:17have so many filters because it's taking
  472. 20:19271
  473. 20:21trades and of course it's paying a lot
  474. 20:23of money just for the fees. So it makes
  475. 20:26sense
  476. 20:28and the win rate isn't really great. But
  477. 20:30anyways, so it ran just fine, but I'm
  478. 20:33going to give it a nine again because I
  479. 20:35didn't like how it defined the indicator
  480. 20:38values and it was using the sequential
  481. 20:41property which wasn't really needed. Now
  482. 20:43the next question is actually really
  483. 20:45interesting. So I'm going to say here's
  484. 20:47the code for my trend following strategy
  485. 20:49in the 15 minutes time frame. The
  486. 20:51strategy is losing money because it is
  487. 20:52taking so many trades and there are
  488. 20:55false breakouts during the ranging
  489. 20:57markets. Please improve the strategy. So
  490. 20:59I'm going to paste the strategy that
  491. 21:01they just gave me. And remember it was
  492. 21:03losing money, right? So I want to see if
  493. 21:06the model is now smart enough if it has
  494. 21:09some actual trading knowledge to know
  495. 21:12what it should do to improve the results
  496. 21:14of such a case. So this isn't really
  497. 21:17related to the syntax, it's related to
  498. 21:19the knowledge and this model is supposed
  499. 21:21to be really good at that. So let's see.
  500. 21:24All right. So here's the code. Let's
  501. 21:26copy it. go back and paste it here. Now
  502. 21:31let's see what is changed.
  503. 21:34So in here other than checking for the
  504. 21:36MACD values and the trend it also added
  505. 21:40both the ADX and the chop indicator. Now
  506. 21:42these are really good. In fact I always
  507. 21:44use them myself. The ADX gives us
  508. 21:46basically whether or not the price is
  509. 21:48volatile enough or not. And the
  510. 21:51choppiness is actually ensuring that
  511. 21:53there is less randomness in the price
  512. 21:56because if there are too many random
  513. 21:57stuff happening in the market, we want
  514. 21:59to stay out of it, right? Because we
  515. 22:01cannot really predict things if
  516. 22:03randomness is all over the place. So I
  517. 22:05actually like this and it shows me that
  518. 22:07the model has some good trading
  519. 22:10knowledge. Now for the chop, it's using
  520. 22:12the 50 threshold and for ADX 25. Now
  521. 22:15both of them are fine. Let's go back and
  522. 22:17run it one more time. Now remember this
  523. 22:20is the result that we had. So we ended
  524. 22:23with 5,696.
  525. 22:27Now we are doing significantly better.
  526. 22:30Now we're still losing money in the end,
  527. 22:32but it's only 2.6%.
  528. 22:36Right? So I'm going to give it a perfect
  529. 22:3810 because it did a good job. Next
  530. 22:40question. Develop a strategy that
  531. 22:42combines the Williams percentage R MACD
  532. 22:45and Ballinger bands. So I expect this
  533. 22:47one to be really easy first. Okay. So
  534. 22:50this seems fine. Let's go back and edit
  535. 22:54the code. Paste it here. Save it. Now
  536. 22:57let's take a look. The volume R is
  537. 23:00defined like this. Now to be honest, I'm
  538. 23:02not sure about the syntax of this in
  539. 23:04Jessie. So we're going to find out when
  540. 23:06we run it. The MACD is fine. The
  541. 23:09Ballinger bands is also fine. For the
  542. 23:11entry, it's saying if the Williams R is
  543. 23:14below minus 80, which is correct, and
  544. 23:17the MAC is above its signal and if the
  545. 23:20closing price is below the lower band.
  546. 23:22So, this seems perfect to me. It's also
  547. 23:25risking only 3% of the available margin
  548. 23:28per each trade, which is a good practice
  549. 23:31in my case. It's also risking 3% per
  550. 23:34each trade, which is good practice.
  551. 23:38And for update position, it's saying if
  552. 23:41it's a long position, but the Williams R
  553. 23:44is now below minus 20 or we're not in
  554. 23:49uptrend anymore or if the price is above
  555. 23:52the upper band of the Ballinger bands,
  556. 23:54then I want to liquidate it. And also
  557. 23:56the opposite for a short trade. So this
  558. 23:58seems really good. Let's run it.
  559. 24:03All right. So this is good especially
  560. 24:06that we are trading it with the 15
  561. 24:08minutes. If I go back and let's say we
  562. 24:12run this with hourly.
  563. 24:16Okay, same numbers. Let's also try 4
  564. 24:19hours.
  565. 24:23Now we ended with a profit but it only
  566. 24:26took two trades.
  567. 24:29So let's also try 30 minutes cuz I'm
  568. 24:32really curious. So, while that's going,
  569. 24:34I want to quickly remind you guys about
  570. 24:35Apex Omni, which is my favorite decks
  571. 24:38made by the team behind Bybit. It has
  572. 24:40low trading fees, instant order
  573. 24:42execution, and of course, no KYC
  574. 24:44whatsoever. If you're going to check
  575. 24:46them out, please consider using our
  576. 24:47link, which not only will give you
  577. 24:49trading fee discounts, but it will also
  578. 24:51support me in order to make more videos
  579. 24:53like this. Okay, it did better. It took
  580. 24:5618 trades. The max draw is minus one. We
  581. 25:00made 6.7%.
  582. 25:02The win rate is 55%. The sharp is 2%.
  583. 25:05>> So, while that's going, I want to
  584. 25:06quickly remind you guys about Apex Omni,
  585. 25:08which is my favorite deck made by the
  586. 25:11team behind. It has low trading fees,
  587. 25:13instant order execution, and of course,
  588. 25:15no KYC whatsoever. If you're going to
  589. 25:18check them out, please consider using
  590. 25:19our link, which not only will give you
  591. 25:21trading fee discounts, but it will also
  592. 25:23support me in order to make more videos.
  593. 25:26>> The sharp is 1.55.
  594. 25:29I really like this. Like if I go back
  595. 25:31here and just increase the size of the
  596. 25:35position with a huge number. Let's say
  597. 25:37five
  598. 25:42and save it.
  599. 25:45So this is pretty interesting. I think I
  600. 25:46found a good strategy kind of by
  601. 25:48accident.
  602. 25:50So now when the maxon is minus 12%,
  603. 25:54we're making 84% over 1.5 years. So this
  604. 25:59is good and it definitely has some real
  605. 26:01potential. All right, so I'm going to
  606. 26:03give it a perfect 10, but I wish I could
  607. 26:05have given it a bigger number. Next,
  608. 26:07write the entry functions of the
  609. 26:09strategy for me in a way that it should
  610. 26:11use two limit orders for opening the
  611. 26:13position and it should only risk 2% of
  612. 26:15capital per trade. Again, this is an
  613. 26:18easy one, but I want to see if it's
  614. 26:21smart enough to just give me one
  615. 26:23function, not the entire strategy,
  616. 26:26because sometimes that's all you need.
  617. 26:27Right now, of course, I could have also
  618. 26:29told the model about this, but I didn't
  619. 26:31do it. I want to see if it's smart
  620. 26:33enough to figure it out. All right, so
  621. 26:35it didn't. That's not great.
  622. 26:40Now, for entry, it is indeed using two
  623. 26:44market orders. So it got that right. So
  624. 26:48it's using half the quantity for the
  625. 26:51first order and for the price it's
  626. 26:53saying the current price minus the
  627. 26:56current ATR multiplied by half and also
  628. 27:00another one exactly one ATR below the
  629. 27:03current price. So this is perfect and it
  630. 27:06is also risking 2% per each trade. So
  631. 27:10it's correct but it's not giving it in
  632. 27:12one single function as I wanted it. It's
  633. 27:15just giving me the entire strategy. So,
  634. 27:18it's good, but I'm going to give it
  635. 27:20nine. Last but not least, write a pair
  636. 27:23trading strategy for ETH and BTC. All
  637. 27:26right. So, for this one, it's supposed
  638. 27:28to give us two strategies and it did do
  639. 27:32that. So, you see we have one master
  640. 27:34strategy which is guiding all the other
  641. 27:38routes and then we have follower
  642. 27:40strategies. The first strategy is
  643. 27:42supposed to make all the decisions and
  644. 27:44it is indeed doing that and using the
  645. 27:46shared VS dictionary in Jessie it's
  646. 27:50storing these variables in a way that
  647. 27:51the second strategy is able to access
  648. 27:54it. So in case you didn't know this is
  649. 27:56the way for strategies in Jesse to
  650. 27:58communicate with each other. Now in this
  651. 28:00case we have only two strategies or two
  652. 28:02symbols but if you were trading let's
  653. 28:04say 10 or 20 or 50 symbols still this
  654. 28:07would have been the way to trade them
  655. 28:09all. Now, let's copy this one.
  656. 28:13Go back to Jesse. But I want to create a
  657. 28:16new strategy. I'm gonna name it test for
  658. 28:20hair one
  659. 28:23and save it. Next, I will create another
  660. 28:27one. I will call it test rock for pair
  661. 28:32two
  662. 28:33and copy this one
  663. 28:37and paste it here.
  664. 28:40Notice that second strategy doesn't have
  665. 28:42trading logics by itself. It's only
  666. 28:44using the values of shared VS to see
  667. 28:48what the decision has been made for it
  668. 28:50by the other strategy. Now, if what I'm
  669. 28:53doing here is a bit too complex for you
  670. 28:55for this specific strategy, make sure to
  671. 28:58watch my previous video called pair
  672. 29:01strategy from a scratch in Python. With
  673. 29:03that one, I explain everything in depth
  674. 29:06about how to go about it. So, let's go
  675. 29:08to the back testing page. And now I'm
  676. 29:11going to define two trading routes. The
  677. 29:14first one for BTC and the second for
  678. 29:16ETHUCT.
  679. 29:18The time frame is 15 minutes. test Grock
  680. 29:22pair one and test Grock pair two. And
  681. 29:27I'm going to disable the fast mode
  682. 29:29because it doesn't work for strategies
  683. 29:31that use multiple trading routes like
  684. 29:34this one. And let's start it.
  685. 29:39And it's saying we're missing candles.
  686. 29:41Okay. So that's because I don't have
  687. 29:42enough candles until this date. So let's
  688. 29:46lower the ending date of the back test.
  689. 29:50Okay, so it's saying that this strategy
  690. 29:53name isn't defined. So let's go back and
  691. 29:57edit the code here. Okay, so this is
  692. 30:00because we only pasted the strategies
  693. 30:03code but not the initial imports. So
  694. 30:05that's fine because you know it does
  695. 30:07have it here. It's assuming that we also
  696. 30:10had it when it define this one. So I
  697. 30:14mean it's okay. It should have given it
  698. 30:16to us, but I'm going to pretend that
  699. 30:19didn't happen. Let's go back and run it
  700. 30:21one more time.
  701. 30:24And now it does go through. Now we're
  702. 30:26losing money. That's fine because it's
  703. 30:28taking a lot of trades.
  704. 30:31And we're paying a lot of money in
  705. 30:33trading fees. In fact, if I go and lower
  706. 30:36the trading fees, let's say to zero, as
  707. 30:39if we own the exchange we were trading
  708. 30:41this on,
  709. 30:43and run it again. Now, we are ending up
  710. 30:47with a little bit of money. Okay, so
  711. 30:49this was really good, but because it
  712. 30:51forgot the imports, I'm going to give it
  713. 30:53a nine. All right, there we go. The
  714. 30:55ending number for this LLM model by the
  715. 30:58Grock team is 85 out of 100. However,
  716. 31:02this is mainly because we gave it a zero
  717. 31:04for this question. But I'm guessing that
  718. 31:07might have to do with the fact that they
  719. 31:09have just released the model and maybe
  720. 31:11their API just was failing in this case
  721. 31:14and maybe even tomorrow or the next day
  722. 31:16if you try it might work and if that's
  723. 31:18the case then this is actually a really
  724. 31:21really good model. In every question we
  725. 31:23basically gave it either 10 or nine. So
  726. 31:26it's really good. So overall, I think I
  727. 31:28really like this model and maybe at
  728. 31:30least whenever Claude Sonnet fails to
  729. 31:33get the job done, I tried it with this
  730. 31:35one. Or maybe vice versa. Maybe I begin
  731. 31:37this one and switch back to CLA when
  732. 31:39this isn't able to get it done. But
  733. 31:41let's not forget that this model is also
  734. 31:43a bit more expensive and I am not sure
  735. 31:46if I can say it is worth the price. Now,
  736. 31:49before I leave, we're going to have a
  737. 31:50giveaway for this video as well. The
  738. 31:52random person who likes this video, post
  739. 31:54a comment, and subscribes to the channel
  740. 31:56is going to win 1 million B token. Now,
  741. 31:58let's pick the winner for the previous
  742. 32:00video.
  743. 32:02[Music]
  744. 32:07And the winner is T5G. I hope I'm
  745. 32:10pronouncing your name correct. It's
  746. 32:12Chinese if I'm not mistaken. Thank you
  747. 32:14so much for your comment. Please reach
  748. 32:15out to me so I can send you your bunk
  749. 32:17tokens. Thanks for watching and I'll see
  750. 32:19you in the next one.
  751. 32:23[Music]

About this transcript

This page contains the full transcript of Grok 4 tested: Is it good for algo-trading strategies? by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 5,341 words across 751 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.