YouTube2Text

GPT OSS tested: Is it good for algo trading strategies? (+ fully local installation) — Transcript

by Algo-trading with Saleh · 2,825 words · 382 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hey guys, it's S. Open AAI just released
  2. 0:02two open-source models in the sizes of
  3. 0:0520 and 120 billion parameters. Now, the
  4. 0:09one that I really care about is the 20
  5. 0:11billion parameter because that is the
  6. 0:13one that I'm able to run it on my local
  7. 0:16Mac machine. So, this is the one that I
  8. 0:18really care about and I couldn't be more
  9. 0:19excited about it because apparently it's
  10. 0:21pretty good and that gives me full
  11. 0:22privacy for my strategies. But of
  12. 0:25course, what we really care about as
  13. 0:26Algo traders is the performance of the
  14. 0:28model for things such as writing
  15. 0:30strategies in Python, debugging our
  16. 0:33existing strategies, or if the model has
  17. 0:35any actual trading knowledge. So, if all
  18. 0:38that sounds interesting to you, let's
  19. 0:39get right into the video. So, here's a
  20. 0:41blog post released by OpenAI and it
  21. 0:44gives us some information about the
  22. 0:46models, but what I really care about is
  23. 0:49the benchmark of it. So let's scroll
  24. 0:51down and here we can see the GPD OSS 20
  25. 0:57billion model without tools and here we
  26. 1:00can see that it is beating slightly the
  27. 1:0303 mini model. So that's pretty amazing
  28. 1:05because I remember 03 mini used to be a
  29. 1:08very good model. So if this is true that
  30. 1:10is fantastic. Now to run this test we
  31. 1:13have two ways. So one is to use JCGPT
  32. 1:15which is our cloud version. It has all
  33. 1:18the instructions for algo trading in
  34. 1:20Python. And even if you don't have a GPU
  35. 1:23of your own, you can just use this model
  36. 1:25and you can check it out here. And this
  37. 1:28new model, especially the 20 billion,
  38. 1:30uses only one credit. So that is by far
  39. 1:33the cheapest model on our list. So even
  40. 1:36if you have a free account on Jess
  41. 1:37trade, you can easily use this model.
  42. 1:40But the whole point of doing this was
  43. 1:42that we could have more privacy, right?
  44. 1:44Because it's open source. So in this
  45. 1:46video I'm not going to do that and
  46. 1:48instead I will show you how to run a
  47. 1:50completely offline version of it. So the
  48. 1:52easiest way to do this is simply
  49. 1:54download LM Studio which is great for
  50. 1:57running local LLM models. Now I already
  51. 2:00did this and in fact if you go to the
  52. 2:02discover page you can see that GPOSS 20
  53. 2:06billion is of this list and I already
  54. 2:08downloaded this but because it's so new
  55. 2:11only the GDUF version is available. So
  56. 2:14the MLX version is now in case you don't
  57. 2:16know what that is, the MLX version or
  58. 2:19LLM models specifically for Apple
  59. 2:21silicon machines. So if I run that
  60. 2:23version which will be out approximately
  61. 2:26tomorrow, I'm going to get 20 to 30%
  62. 2:29better performance. So same machine but
  63. 2:3120 or 30% better performance. So that's
  64. 2:33really amazing. Now again I already
  65. 2:35downloaded this. All right. So now we
  66. 2:37are able to load the model. So let's go
  67. 2:39here. Click here. Now, make sure to
  68. 2:41increase the context length because by
  69. 2:42default it is set to 4,000. That's very
  70. 2:45low for our use case. So, I'm going to
  71. 2:47set this to at least 30,000, but the max
  72. 2:51supported value for this model is
  73. 2:53131,000. So, that's pretty amazing. Now,
  74. 2:56I'm seeing some new options on LM
  75. 2:58Studio. I don't know if it's just for
  76. 3:00this model or it came with the new
  77. 3:02version of LM Studio, but to be honest
  78. 3:04with you, I'm not sure how to change
  79. 3:06these things. So, I'm just going to let
  80. 3:07them what it is. It also gives us a
  81. 3:11setting for number of experts. By
  82. 3:12default, it is set to four, but I'm
  83. 3:15really curious to know what would happen
  84. 3:17if I increase this. So, anyways, let's
  85. 3:19load the model. It's going to take a
  86. 3:21while for this. All right. So, let's ask
  87. 3:24it to
  88. 3:27give me the entry and exit rules of a
  89. 3:29golden cross strategy in Python.
  90. 3:33Okay, so it's Python, not PyTorch. Let's
  91. 3:36hit enter. And you see the model is
  92. 3:38extremely fast and it is also a
  93. 3:40reasoning model. So that's why it is
  94. 3:42thinking before giving us the answer. So
  95. 3:45it is giving me
  96. 3:48the integrals.
  97. 3:51It actually gave me some pseudo code. So
  98. 3:54this is good. Then it is explaining the
  99. 3:56code turning signals into position. So
  100. 4:00yeah because you know by default it
  101. 4:02doesn't know about Jesse framework. It
  102. 4:04doesn't know how we're going to trade
  103. 4:05this or back test it. So, this is
  104. 4:07perfectly fine and pretty good.
  105. 4:11Okay, so this seems really good. But
  106. 4:12what I want to show you is this. You see
  107. 4:14this value here? 66 token per second. So
  108. 4:18that's the speed of the model. If I'm
  109. 4:21able to run the MLX version, which will
  110. 4:23come out tomorrow, I'm going to get like
  111. 4:2580 or 90 token per second. So that's why
  112. 4:29you would really care about the MLX
  113. 4:31version. But anyway, so this is
  114. 4:32perfectly acceptable. But now in order
  115. 4:35to make sure the model is able to give
  116. 4:38us answers for algo trading in
  117. 4:40framework, which is something we can
  118. 4:42actually back test or even live trade,
  119. 4:45I'm going to have to go to this settings
  120. 4:47page. And you see, you're going to have
  121. 4:49to create a new preset and give it the
  122. 4:51instructions. Now I'm going to paste the
  123. 4:53whole instructions here. And it is
  124. 4:55taking 20,000 tokens. So they are huge.
  125. 4:59it. This has all the rules of the J
  126. 5:02framework. It has a lot of examples in
  127. 5:04it. So, this is really great. And in
  128. 5:07case you're curious, yes, I'm going to
  129. 5:09link to the repository that has this
  130. 5:11instructions and leave it on the
  131. 5:13description section of the video. Now,
  132. 5:16the next thing is this model page. And
  133. 5:20we need to change this temperature value
  134. 5:22here. By default, I think this is set to
  135. 5:240.5, but I have lowered it to 0.3. Now,
  136. 5:29by the way, the temperature value is how
  137. 5:31much you want the model to be creative.
  138. 5:33So, the bigger it is, the more likely
  139. 5:35the model is going to give you good
  140. 5:37ideas, but it will also do more
  141. 5:39hallucinations and I want to prevent
  142. 5:41that. So, for that reason, I'm going to
  143. 5:43set this to a value such as 0.3 or even
  144. 5:460.2. And once you're done with this,
  145. 5:48make sure to commit the changes. And now
  146. 5:50if I go and ask the same thing from the
  147. 5:53model. So let's go down here and simply
  148. 5:56click on the regenerate message button.
  149. 5:58You see now it is processing the prompt.
  150. 6:01So it's taking a lot longer for it to
  151. 6:03begin. And that is because we are now
  152. 6:05feeding the model with 20,000 tokens of
  153. 6:08input. So of course it's going to take
  154. 6:10some time for the model to begin. But
  155. 6:12once this initial prompt is over and it
  156. 6:15starts giving us answers, my follow-up
  157. 6:18questions of the model are going to
  158. 6:20start almost instantly. So this is just
  159. 6:22a one-time thing. Don't worry about it.
  160. 6:24But still, even with that, you see when
  161. 6:27it is printing the result, it is
  162. 6:29significantly slower. Now it is slower,
  163. 6:31but it is still fast enough. So I'm not
  164. 6:33really sad about this. And what I'm
  165. 6:37curious is the answer. So you see now it
  166. 6:39is using the current syntax of the Jing
  167. 6:41framework. And this is perfectly
  168. 6:43correct. But I found the model to
  169. 6:46sometimes write the strategy with a
  170. 6:48weird syntax. So here it defined the
  171. 6:50property, but it didn't go to the next
  172. 6:52line and it just continued it like this.
  173. 6:54I believe this should work, but it's a
  174. 6:57bit odd. Now, another thing that I
  175. 6:59noticed with this model is that it tends
  176. 7:01to print a lot of comments and I really
  177. 7:03like that. I think it's really helpful.
  178. 7:05So let's wait for the whole thing. All
  179. 7:08right. So now with the same prompt it
  180. 7:10gave us an actual strategy that we are
  181. 7:13able to run. So that's why these
  182. 7:15instructions are super helpful. Now
  183. 7:17let's go through the code very quickly.
  184. 7:19So it defined two indicators. So one is
  185. 7:22for moving average with the 20 period
  186. 7:24and another with 50. The syntax is
  187. 7:27simply trending EMA and then it is
  188. 7:29passing the current candles which is a
  189. 7:31perfectly correct syntax in Jesse. It
  190. 7:33repeated that with the period of 50 in
  191. 7:36the inter rule of the strategy which we
  192. 7:38call shoot long in Jessie is it's saying
  193. 7:41if it's the first index return false
  194. 7:44because we don't have any previous data.
  195. 7:46So this isn't correct actually. So this
  196. 7:48shouldn't even be here but it is trying
  197. 7:50to fetch the previous value of the EMA
  198. 7:5220 with this syntax. This again is
  199. 7:55incorrect because when you use this
  200. 7:57syntax with Jesse, it will only give you
  201. 7:59one value and that is the value of the
  202. 8:02current indicator. So, it's not even a
  203. 8:05list and this isn't correct. Now, this
  204. 8:08is a bit weird because the previous
  205. 8:09times that I ran this, it worked just
  206. 8:11fine, but right now it's not. I'm not
  207. 8:13sure why that is. Now, it is not
  208. 8:14shorting. Okay, that's fine cuz we
  209. 8:16didn't ask it. And for the update
  210. 8:19position function, which only happens
  211. 8:21whenever a new candle closes, it's
  212. 8:23saying if it's a long position and the
  213. 8:26EMA 20 is below EMA 50, which is kind of
  214. 8:29a death cross. So in that case, liquid
  215. 8:32the current position. This is correct
  216. 8:34syntax. For the position sizing, it's
  217. 8:36saying the entry is going to be the
  218. 8:37current price. The stop is also going to
  219. 8:40be the current entry minus two times of
  220. 8:42the current ATR. This is correct. It is
  221. 8:45risking 3% per each trade with the risk
  222. 8:49to quantity utility function of Jesse.
  223. 8:51This is perfectly correct. And to submit
  224. 8:53the buy order, which is our entry order,
  225. 8:54it's saying sell by equals quantity and
  226. 8:57then the entry. Again, this is correct.
  227. 8:59It's saying once the position is open,
  228. 9:01if it's a long position, the stop loss
  229. 9:02is going to be the quantity of the
  230. 9:04current position. Again, correct syntax.
  231. 9:06And the price of it is going to be the
  232. 9:08current price minus two times of the
  233. 9:11current ATR. So the two is here actually
  234. 9:14and the take profit is going to be four
  235. 9:16times of that. So it has a
  236. 9:17risk-to-reward ratio of two. That's
  237. 9:19really great. And then it defined the
  238. 9:21watch list which is useful if you want
  239. 9:23to trade the strategy live and see the
  240. 9:25values in real time. So it's really
  241. 9:28great. I like it. But now the token per
  242. 9:31second is only 13. So it is
  243. 9:33significantly lower but still acceptable
  244. 9:36for a completely offline model. Now
  245. 9:38guys, you know that I usually go through
  246. 9:41all the questions and show you the
  247. 9:43answers of the model. But in this video,
  248. 9:46I'm not going to do that because I
  249. 9:48actually did that. And after recording
  250. 9:51the whole video, I realized that my
  251. 9:53audio wasn't on. And right now,
  252. 9:55unfortunately, I don't have time to
  253. 9:57re-record the whole thing. So, I'm just
  254. 9:59going to show you the ending result. And
  255. 10:02I need you to trust me that I did run
  256. 10:04these tests and these are the final
  257. 10:06results that I was getting. So it got
  258. 10:08most of the questions right. In fact, it
  259. 10:10is getting perfect 10 in most of them.
  260. 10:12Now with this one, it wasn't able to
  261. 10:15complete the task which was to convert a
  262. 10:16pin script strategy into Python code.
  263. 10:19But whenever I ask it to write a
  264. 10:20strategies, for example, write golden
  265. 10:23cross strategy, it nailed it. I asked it
  266. 10:25to develop a mean version of strategy
  267. 10:27using Ballinger bands and the RSI with
  268. 10:29this period of seven. It nailed that
  269. 10:32question. I asked it to write a strategy
  270. 10:34that uses Fibonacci retracement levels
  271. 10:36for entry and exit points. It did it
  272. 10:38beautifully and in all of these things
  273. 10:40it was writing a lot of helpful comments
  274. 10:43and that's something that I hadn't seen
  275. 10:45in any other model. Then I asked it to
  276. 10:48update my existing strategy code to add
  277. 10:50some chart values. It wasn't able to do
  278. 10:53a great job but it wasn't complete fail.
  279. 10:55Then I asked it to write a trend
  280. 10:57following strategy that uses 15 minutes
  281. 10:59time frame for entry and the 4 time
  282. 11:01frame for confirmation. So this is
  283. 11:02something that we can only do with J
  284. 11:04framework because if you try to use a
  285. 11:07bigger time frame in let's say trading
  286. 11:09views pin script you're going to hit the
  287. 11:11look ahead bias which means you will be
  288. 11:13using the price from the future and
  289. 11:15you're going to get unrealistic results
  290. 11:17but in Jesse that's not the case. Now
  291. 11:19anyways the model was able to write a
  292. 11:22very good strategy with that but I
  293. 11:24needed to tweak one thing so get to get
  294. 11:27it working and that's why I give it a 9
  295. 11:29out of 10. Now for this question, I
  296. 11:31asked it to improve my existing strategy
  297. 11:34which was trading the 15 minutes time
  298. 11:36frame. Now the strategy was losing money
  299. 11:38because it was taking too many trades
  300. 11:40when a lot of false breakouts were
  301. 11:42happening. So I needed to know if the
  302. 11:44model has some actual trading knowledge
  303. 11:45to know what to do in these kind of
  304. 11:47situations like what kind of filters it
  305. 11:49will define to take less trades but only
  306. 11:52trades that are actually worth it and it
  307. 11:54wasn't helpful at all with that. So I
  308. 11:56give it a zero. Next, I asked it to
  309. 11:58develop a strategy that combines the
  310. 12:00Williams percentage R, MACD, and
  311. 12:02Ballinger bands. Now, I had to make two
  312. 12:04changes to get it working, but it was
  313. 12:06perfect. So, I give it eight. Next, I
  314. 12:08asked it to write the entry functions of
  315. 12:10the strategy for me in a way that it
  316. 12:12should use two limit orders for opening
  317. 12:14the position, and it should only risk
  318. 12:162%age of capital per trade and it was
  319. 12:19able to nail that. So it knows the
  320. 12:21correct syntax for this framework to not
  321. 12:23only use one order to open positions but
  322. 12:26multiple. Next I asked it to write the
  323. 12:28press reading strategy for ETH and BTC
  324. 12:31and it was able to nail that question.
  325. 12:34So overall these scores aren't as high
  326. 12:36as the previous models that I reviewed
  327. 12:38on this channel. But I believe this one
  328. 12:40is still a very good one because all of
  329. 12:43those models they had prompters bigger
  330. 12:45than 100 billion at least. We're
  331. 12:48actually able to run this one completely
  332. 12:49locally and that is very valuable and
  333. 12:52also with the questions that it didn't
  334. 12:53get them working. I don't really care
  335. 12:56because it still did a great job with
  336. 12:58the other questions. So I believe this
  337. 13:00model is perfectly usable on your local
  338. 13:02machine if you are able to run it. And
  339. 13:05even if you use a cloud version of it,
  340. 13:07yes, you will lose some of your privacy,
  341. 13:09but the pricing of it is significantly
  342. 13:11low, which means that you can use it all
  343. 13:14the time for research. So, I believe
  344. 13:16OpenAI just did a wonderful job and I
  345. 13:20wasn't expecting this at all. Like,
  346. 13:22considering their previous releases and
  347. 13:24how expensive those models were and not
  348. 13:26actually really useful, I had no idea
  349. 13:29that their open source model is going to
  350. 13:31be this good. And by the way, recently I
  351. 13:33also installed the coin tree coder
  352. 13:36model. You know, the one that has lower
  353. 13:38parameters and I was able to run it on
  354. 13:40my MacBook machine and it was good, but
  355. 13:43it wasn't nearly as good as this one. So
  356. 13:45in case you are an open-source model
  357. 13:48enthusiast like myself then you should
  358. 13:50know this because again I think this is
  359. 13:53the king of the open source models at
  360. 13:55least the ones that you are able to run
  361. 13:57them locally. Now there is another setup
  362. 13:59that I'm really curious to try and that
  363. 14:01is using an aentic framework for it. So
  364. 14:04if we set up this model that way we
  365. 14:07won't just ask the model to give us the
  366. 14:09strategies copy and paste it into Jesse
  367. 14:12and back test and see if it works or
  368. 14:13not. it will be able to edit the source
  369. 14:15of the strategy for us. So, it's super
  370. 14:17helpful. So, if that's the kind of setup
  371. 14:20that you want to see, let me know in the
  372. 14:21comments and I might record a video just
  373. 14:23about that. Now, if you guys want me to
  374. 14:25make more videos like this, please like
  375. 14:26the video, subscribe to the channel, and
  376. 14:28give me your opinion in the comment
  377. 14:30section. It helps me out a lot. Thank
  378. 14:32you so much for watching, and I'll see
  379. 14:33you in the next one.
  380. 14:35[Music]
  381. 14:38[Applause]
  382. 14:40[Music]

About this transcript

This page contains the full transcript of GPT OSS tested: Is it good for algo trading strategies? (+ fully local installation) by Algo-trading with Saleh, generated from the public captions YouTube serves with the video. The transcript has 2,825 words across 382 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.