Stock Chart Analysis with GPT4o Omni (Python Tutorial)

Part Time Larry
13 May 202408:40

Summary

TLDRThe video script discusses the release of Open AI's new model, GP40, which excels in vision and audio understanding. The creator tests its vision capabilities by integrating it with a Python program for stock analysis, allowing GP40 to perform technical analysis on stock charts through screenshots. The script details the process in Python, showcasing GP40's ability to analyze and describe price action, support/resistance levels, and indicators in real-time. The video also hints at the broader implications of such advanced AI integration, suggesting a future where manual technical analysis might become obsolete.

Takeaways

  • ๐Ÿš€ OpenAI has released a new model called GP4, with 'O' standing for Omni, which can handle text, audio, and image inputs and outputs.
  • ๐Ÿ” GP4 is particularly enhanced in vision and audio understanding, offering improved capabilities over previous models.
  • ๐Ÿ“š The speaker suggests watching all demos to see the model's capabilities but focuses on quickly testing its audio or vision features.
  • ๐Ÿ’ป The speaker tests the vision functionality of GP4 by integrating it with a Python program that interacts with the Interactive Brokers TWS API for stock data.
  • ๐Ÿ“ˆ The program can pull up popular stock charts and perform technical analysis on them by analyzing screenshots of the charts.
  • ๐Ÿ“ธ The speaker demonstrates how to take a screenshot of a stock chart and have GP4 provide a markdown description of the chart's analysis.
  • ๐Ÿ› ๏ธ The Python code for integrating GP4 with the stock analysis program involves using the 'take screenshot' function and adding an 'analyze chart' function.
  • ๐Ÿ”‘ To use GP4, an OpenAI key is required, and the user must specify the organization ID for billing purposes.
  • ๐Ÿ–ผ๏ธ The image for analysis needs to be base64 encoded before being passed to the GP4 model for analysis.
  • ๐Ÿ“ The analysis results from GP4 are returned as text, which can be printed on the screen and saved to a markdown file.
  • ๐Ÿ”ฎ The speaker also tests GP4's ability to analyze more complex visuals like heat maps and describes its potential integration into desktop applications for real-time analysis.

Q & A

  • What is the new model released by Open AI called?

    -The new model released by Open AI is called GP4, where 'O' stands for Omni.

  • What capabilities does the GP4 model have?

    -The GP4 model can input text, audio, and images, and generate audio, text, and image outputs in return. It is especially better at vision and audio understanding compared to existing models.

  • What was the purpose of the video posted by the speaker?

    -The purpose of the video was to test the vision capabilities of GP4 by analyzing stock charts and integrating an AI feature into a desktop app created by the speaker.

  • How does the speaker's Python program interact with the stock market?

    -The speaker's Python program interacts with the Interactive Brokers TWS API to pull data on stocks, display charts, and scan for the most popular stocks of the day.

  • What feature did the speaker add to their desktop app in a previous video?

    -In a previous video, the speaker added a screenshot functionality to their desktop app, allowing them to capture and analyze stock charts.

  • How does the GP4 model provide technical analysis of a chart?

    -The GP4 model provides technical analysis by analyzing a Base64 encoded image of the chart and returning a markdown description of the chart's analysis.

  • What is required to call the GP4 model for image analysis in Python code?

    -To call the GP4 model for image analysis, one needs to pass the model name, the path to the image, and a user role with a specific message requesting the analysis.

  • How is the image of the chart encoded before being analyzed by GP4?

    -The image of the chart is Base64 encoded before being passed as part of the message to the GP4 model for analysis.

  • What additional feature did the speaker add to their app for chart analysis?

    -The speaker added the ability to draw trend lines on the charts and have GP4 analyze the drawings in real time.

  • How does the GP4 model's analysis compare to previous models?

    -The GP4 model's analysis is far superior in quality compared to previous models, providing more detailed and sophisticated insights into the charts.

  • What implications does the speaker foresee for technical analysts with the advancement of AI like GP4?

    -The speaker suggests that technical analysts might become obsolete as AI models like GP4 can perform complex analysis tasks with high accuracy and speed.

  • What other types of visualizations did the speaker test with GP4?

    -The speaker tested GP4 with a heat map for sector analysis, demonstrating the model's ability to interpret and describe complex charts with multiple symbols and details.

  • What future developments does the speaker anticipate with the integration of AI like GP4 into desktop applications?

    -The speaker anticipates that AI integration will lead to real-time analysis and monitoring of user activities on their computers, potentially making current programming and analysis methods obsolete.

Outlines

00:00

๐Ÿš€ Introduction to GPT-40's Multimodal Capabilities

The script introduces a new model called GPT-40, with 'O' standing for Omni, highlighting its ability to process text, audio, and images and generate outputs across these modalities. The model is noted for its improved vision and audio understanding. The speaker tests GPT-40's vision capabilities by integrating it with a Python program that interacts with the Interactive Brokers TWS API, pulling stock data and performing technical analysis on charts by analyzing screenshots of the stock charts, providing a markdown description of the chart's analysis automatically.

05:02

๐Ÿ“ˆ Demonstrating GPT-40's Technical Analysis on Stock Charts

The speaker describes the process of using GPT-40 to analyze stock charts by taking screenshots and generating real-time technical analysis. The Python code is explained, detailing how to trigger a screenshot, save it, and then use GPT-40 to analyze the chart. The analysis includes price action, support and resistance levels, and any indicators present on the chart. The speaker also mentions the potential for GPT-40 to interpret drawings on the chart, such as trend lines, and provides an example of GPT-40 analyzing a chart with a drawn trend line. The quality of analysis is noted to be superior to previous models, and the speaker reflects on the implications for technical analysts and the potential integration of such AI capabilities into desktop applications for real-time analysis.

Mindmap

Keywords

๐Ÿ’กGP4

GP4 refers to a new model released by Open AI, which stands for 'Omni' and is capable of processing and generating text, audio, and image outputs. It is a central theme of the video as the creator explores its capabilities, especially in vision and audio understanding. The script mentions testing the vision functionality of GP4 by analyzing stock charts.

๐Ÿ’กTechnical Analysis

Technical analysis is the examination of stock charts and data to predict future price movements based on historical patterns. In the video, the creator uses GP4 to perform technical analysis on stock charts by simply taking a screenshot, and GP4 provides a markdown description of the chart's analysis.

๐Ÿ’กAPI

API stands for Application Programming Interface, which is a set of rules and protocols that allows different software applications to communicate with each other. The video script describes using the interactive brokers TWS API to pull stock data, demonstrating how APIs facilitate data retrieval for analysis.

๐Ÿ’กScreenshot

A screenshot is a digital image captured by a device's screen output. In the context of the video, the creator uses a Python program to take screenshots of stock charts, which are then analyzed by GP4, showing how screenshots can be utilized for automated analysis.

๐Ÿ’กBase64 Encoding

Base64 encoding is a method used to convert binary data into ASCII string format, which can then be transmitted over text-based communication protocols. The script describes the need to Base64 encode images before sending them to GP4 for analysis, illustrating the technical process involved in image data transmission.

๐Ÿ’กData URL

A data URL is a type of URL that contains encoded data, allowing for direct embedding of data within web pages. The video script mentions using a data URL with a Base64 encoded image to pass the image to GP4 for analysis, showcasing a practical application of data URLs in web development and AI interaction.

๐Ÿ’กMarkdown

Markdown is a lightweight markup language used for creating formatted text using a simple syntax. The video script describes GP4 generating a markdown description of stock charts, highlighting how markdown can be used for concise and clear documentation of technical analysis.

๐Ÿ’กPython

Python is a high-level programming language known for its readability and versatility. The video script includes a Python program that interacts with an API and uses GP4 for analysis, demonstrating Python's role in integrating AI capabilities into custom applications.

๐Ÿ’กStock Chart

A stock chart is a graphical representation of a stock's trading activity, typically showing price movements over time. The video script discusses analyzing stock charts using GP4, emphasizing the practical application of AI in financial analysis and decision-making.

๐Ÿ’กTrend Line

A trend line in technical analysis is a line drawn on a chart to represent the direction of price movement. The video script mentions the ability to draw trend lines on stock charts and have GP4 interpret them, illustrating the AI's capability to understand and analyze graphical elements.

๐Ÿ’กHeat Map

A heat map is a graphical representation of data where individual values are represented as colors. The video script describes GP4's ability to analyze a heat map of sector analysis, showing how AI can process complex visual data to provide insights.

Highlights

OpenAI released a new model called GPT-4o, with 'O' standing for Omni, capable of handling text, audio, and image inputs and outputs.

GPT-4o is particularly enhanced in vision and audio understanding compared to previous models.

The model allows for the integration of AI features into desktop applications, such as technical analysis of stock charts.

GPT-4o can analyze and provide a markdown description of stock charts from screenshots.

The integration of GPT-4o with a Python program enables automatic technical analysis of stock data through the interactive brokers API.

GPT-4o's analysis includes price action, volume, support and resistance levels, and indicators from the stock charts.

The model can interpret and analyze drawings on stock charts, such as trend lines.

GPT-4o can provide real-time analysis of complex data visualizations, such as heat maps.

The quality of analysis from GPT-4o is superior to previous models, offering more detailed insights.

GPT-4o's capabilities can potentially make traditional technical analysts' roles obsolete.

The model's real-time translation and multimodal capabilities can support various applications, including voice-activated systems.

GPT-4o can understand and generate speech with emotional nuances, effective for sensitive communication.

The model supports file uploads for analyzing specific data beyond its knowledge cutoff.

GPT-4o has a large context window of up to 128,000 tokens, allowing coherence over long conversations or documents.

The model includes enhanced safety protocols to minimize the generation of incorrect or misleading information.

GPT-4o's advanced reasoning and instruction-following capabilities expedited the safety work of OpenAI.

OpenAI's new flagship model, GPT-4o, is faster and improves on its capabilities across text, voice, and vision.

Transcripts

play00:00

a couple of hours ago open AI released a

play00:02

new model called gp4 o the O stands for

play00:05

Omni so what this model allows you to do

play00:08

is to input text audio and images and

play00:11

generate uh audio text and image outputs

play00:14

in return and so the note here is that

play00:16

GPT 40 is especially better at vision

play00:19

and audio understanding compared to

play00:21

existing models I suggest you watch all

play00:23

the demos here there's a lot of great

play00:25

capabilities but I just wanted to make

play00:27

something quickly to see if I even had

play00:29

access to this and it turns out I do so

play00:31

what I wanted to do was test out either

play00:33

the audio or Vision capabilities now

play00:35

since yesterday I just posted a video on

play00:38

uh uh programming my brokerage account

play00:40

and saving a different charts from that

play00:42

I thought I would test the uh Vision

play00:44

functionality of GPT 40 and so if you

play00:47

didn't watch my video yesterday uh it

play00:49

looks like this so I can run this and

play00:51

what this does uh this is a Python

play00:53

program that interacts with the

play00:55

interactive brokers twws API and is able

play00:57

to pull data uh on stocks and so here

play01:00

you see I have a a chart for Taiwan

play01:03

semiconductor right here but this also

play01:05

scans and automatically pulls up the

play01:07

most popular stocks for today uh so you

play01:10

can see uh AMC and gme are very active

play01:13

so I click gme and of course roaring

play01:15

Kitty came back to Twitter and gme just

play01:18

spiked right there so what does this

play01:19

have to do with GPD 40 well I thought I

play01:22

would just throw on an AI feature to

play01:25

this little desktop app that I've

play01:26

created and so one thing I did in the uh

play01:29

previous video video is I added the

play01:30

screenshot functionality and so what I

play01:32

can do is when I when I pull up my chart

play01:35

so if I click on AMC here pulls up that

play01:37

chart if I click on gme pulls up that

play01:39

chart and then I can pull up a

play01:41

particular time frame like the 1 hour

play01:43

and so this is interacting with my

play01:44

broker's account and now what I want to

play01:46

do is take a screenshot so I'm going to

play01:48

click screenshot you'll see it saves a

play01:50

screenshot to my screenshot directory of

play01:52

how the chart looked and then you see

play01:54

right here what I'm doing is telling GPT

play01:56

40 to actually do technical analysis on

play01:59

that chart by just looking at it and so

play02:01

you can see every time I take a

play02:02

screenshot now it gives me a complete

play02:05

markdown description of that chart so

play02:08

let's say I'm just saving charts uh

play02:09

throughout my day I automatically get a

play02:12

log uh of some analysis and text format

play02:15

of that chart and so I don't even

play02:17

necessarily have to look at it it just

play02:19

pretend you're saving some type of

play02:20

Journal it's automatic for you and so I

play02:23

click so I took a screenshot of gme and

play02:25

it says a short-term movement shows a

play02:27

significant spike in the price of gme

play02:30

and it shows um it peaked at 3820 and

play02:33

then it talks about the volume that's on

play02:35

that chart it talks about a support and

play02:37

resistance level and the indicators that

play02:39

I had on the chart so how does this

play02:41

actually work in Python code well if you

play02:43

followed my tutorial yesterday there is

play02:45

a function called uh take screenshot so

play02:47

when I click this button I'm

play02:48

automatically triggering and saving a

play02:50

screenshot to a particular directory so

play02:53

all I did was add on to this function so

play02:55

I had a chart file name and I was

play02:56

writing the image right there so all I

play02:59

need to do is is write a little call to

play03:01

gbd4 that actually analyzes this chart

play03:04

and so after I write the image to the

play03:06

file system I have this little analyze

play03:08

chart function so I created a new file

play03:11

here that I just called gp4 technical

play03:13

analyst just like with my other open AI

play03:16

tutorials you need to pass in an open AI

play03:18

key you can set it as an environment

play03:19

variable uh when you initialize the open

play03:22

AI client you need you can give it a

play03:24

default organization or in my case I'm

play03:26

part of many organizations so I need to

play03:28

pass in an organization ID to make sure

play03:30

I'm billing this to the right

play03:31

organization which is mine um so I have

play03:34

this analyzed chart function and all it

play03:36

does is accept the path to an image and

play03:39

so since I'm saving each screenshot and

play03:41

timestamping it uh to a screenshots

play03:44

directory right here I'm just as soon as

play03:46

I write that file name I'm passing the

play03:48

path over to analyze chart and to call

play03:50

the open AI uh GPT 40 model you just

play03:53

need to pass in a the new model name

play03:55

assuming you have access to it so I have

play03:57

access to gp40 and I just use the open

play04:01

AI uh client here to create a chat

play04:03

completion and I can just give it a user

play04:06

role here and just say analyze this

play04:07

chart include the symbol and discuss the

play04:10

price action you can make this more and

play04:11

more sophisticated if you want to focus

play04:13

on particular elements so let's say you

play04:15

want to act as a a trend follower or

play04:18

someone that's looking for mean

play04:19

reversion or you can you can really

play04:21

specify how you want the analysis to be

play04:23

done now the key to using this um if

play04:26

you've used gp4 vision is you need to

play04:28

actually base 64 or encode the image and

play04:31

so you can see in my chart path here I

play04:33

have this function called encode image

play04:35

um and so what you do is import uh you

play04:38

import base 64 here and you can base 64

play04:41

encode that image and once you do that

play04:43

you can actually pass this as part of

play04:46

the message and so instead of a normal

play04:48

like URL you would request on the web

play04:50

you can pass it this special data URL

play04:52

with a Bas 64 encoded image and then you

play04:55

just return back the response and so it

play04:57

just returns a normal uh chat completion

play04:59

right there and then you can see right

play05:01

here um in my analyze chart I'm

play05:04

returning the analysis as a text here

play05:06

and printing it at out on the screen and

play05:09

then I also uh output all that text uh

play05:12

to a file usually just basic python open

play05:14

a new text file and I'm just saving it

play05:16

to a markdown file right here and so

play05:18

you'll notice um if I pull up one more

play05:20

chart here let's just do this one more

play05:22

time I can even uh probably make it

play05:24

analyze my drawings here and so

play05:26

yesterday I added this ability to draw a

play05:28

trend line for instance on here and so I

play05:31

can draw a little trend line here and

play05:33

you know see how it would interpret this

play05:34

in real time so I'm going to do

play05:35

screenshot right there and you see it's

play05:38

saving a screenshot of AMC exactly as it

play05:40

looked with my trend line right in place

play05:42

and you see right there I have the

play05:44

analysis from

play05:45

gp40 in real time displays price action

play05:48

for the symbol uh AMC it appears to be a

play05:51

multi-hour chart uh it's been on upward

play05:54

trajectory for most of the session uh

play05:57

and then yeah you see it proceeds to

play05:59

give some analysis and let's see if it

play06:01

mentions uh yeah a a strong upward Trend

play06:04

initially with a pullback and yeah and

play06:07

so it's interpreting the chart just as

play06:09

I've drawn it right there and let's see

play06:11

if it even mentions yeah it says after

play06:13

reaching 588 and so if you watched

play06:16

yesterday I calculated the uh the high

play06:19

of the day and had it automatically draw

play06:21

a horizontal line and it detects that as

play06:23

well so yeah that's my first experience

play06:26

with GPT 40 you might say you were able

play06:28

to analyze images with gp4 vision in the

play06:31

past but one thing I'm noticing is the

play06:33

analysis provided by gp40 is already

play06:36

much better so the quality of that

play06:37

analysis I just showed is far superior

play06:40

to um what I had done with gp4 gp4 uh

play06:43

Vision in the past oh and I forgot to

play06:46

show that um I've actually been testing

play06:48

this out in other contexts so I have

play06:50

like a heat map uh here so uh for sector

play06:53

analysis right here it can actually look

play06:55

at this heat map and describe it um this

play06:57

ETF uh chart from vvis and then also um

play07:01

another chart I was looking at as well

play07:03

and so just to show you the a heat map

play07:06

example yeah you can see how it's able

play07:07

to look at this very uh sophisticated

play07:10

heat map not that sophisticated but

play07:12

there's lots of details and many

play07:14

different symbols on this heat map it

play07:16

can do it a lot faster than I can as a

play07:18

human so you can see how I can pinpoint

play07:20

what's going on in

play07:21

energy uh Tesla Amazon all those things

play07:24

are very small on this chart and it's

play07:26

able to pick up all the individual

play07:28

percentage moves and so if I look on uh

play07:32

technology here you see apple up by

play07:34

2.05% it read that off the chart Nvidia

play07:37

so it can actually see um what's going

play07:39

on so yeah I expect a lot of this stuff

play07:42

I know I may had to make a program for

play07:44

this but I expect all of it to be very

play07:46

integrated into your desktop they just

play07:47

released a a desktop application as well

play07:50

that can see your screen and so I can

play07:52

you can imagine what where we're headed

play07:54

here where you know the big tech company

play07:56

is going to be watching everything

play07:57

you're doing on your computer and

play07:58

analyzing in real time and so yeah um so

play08:02

is this all going to be obsolete do I

play08:04

need to teach anyone how to program when

play08:06

gp4 can listen to you and answer all of

play08:09

your questions uh yeah maybe we're all

play08:11

obsolete definitely all the uh technical

play08:14

analysts are kind of obsolete we don't

play08:15

need anyone to talk about uh charts and

play08:17

visualizations uh necessarily if this

play08:20

thing uh gets really really good over

play08:22

time uh so so yeah I'm excited about the

play08:25

possibilities but also it's kind of

play08:27

blows my mind uh some of the things that

play08:29

were shown in this demo so I'll post

play08:31

this code somewhere uh hopefully this

play08:33

was interesting uh be having some fun

play08:35

with this and hopefully we'll share more

play08:37

uh in the coming weeks and months all

play08:39

right take it easy bye

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
GPT-40Stock AnalysisTechnical AnalysisAI VisionPython CodingAPI IntegrationReal-time DataMarket TrendsInvestment ToolsTech Innovation