Skip to content

Commit 827c5e7

Browse files
committed
quick comm
1 parent 5202024 commit 827c5e7

File tree

8 files changed

+269
-1
lines changed

8 files changed

+269
-1
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ __pycache__/
77
env/
88
build/
99
develop-eggs/
10-
dist/
1110
downloads/
1211
eggs/
1312
.eggs/
@@ -24,6 +23,12 @@ wheels/
2423
# PyInstaller
2524
*.manifest
2625
*.spec
26+
!NVDA_TSM_Ratio_Chart.spec
27+
28+
# Keep the executable and its README
29+
!dist/
30+
!dist/NVDA_TSM_Ratio_Chart.exe
31+
!dist/README.txt
2732

2833
# Logs
2934
*.log

NVDA_TSM_Ratio_Chart.spec

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
from PyInstaller.utils.hooks import collect_all
3+
4+
datas = [('README.txt', '.')]
5+
binaries = []
6+
hiddenimports = []
7+
tmp_ret = collect_all('numpy')
8+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
9+
tmp_ret = collect_all('pandas')
10+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
11+
tmp_ret = collect_all('matplotlib')
12+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
13+
tmp_ret = collect_all('pytz')
14+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
15+
tmp_ret = collect_all('ib_insync')
16+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
17+
18+
19+
a = Analysis(
20+
['stock_ratio_chart.py'],
21+
pathex=[],
22+
binaries=binaries,
23+
datas=datas,
24+
hiddenimports=hiddenimports,
25+
hookspath=[],
26+
hooksconfig={},
27+
runtime_hooks=[],
28+
excludes=[],
29+
noarchive=False,
30+
optimize=0,
31+
)
32+
pyz = PYZ(a.pure)
33+
34+
exe = EXE(
35+
pyz,
36+
a.scripts,
37+
a.binaries,
38+
a.datas,
39+
[],
40+
name='NVDA_TSM_Ratio_Chart',
41+
debug=False,
42+
bootloader_ignore_signals=False,
43+
strip=False,
44+
upx=True,
45+
upx_exclude=[],
46+
runtime_tmpdir=None,
47+
console=False,
48+
disable_windowed_traceback=False,
49+
argv_emulation=False,
50+
target_arch=None,
51+
codesign_identity=None,
52+
entitlements_file=None,
53+
)
54+
app = BUNDLE(
55+
exe,
56+
name='NVDA_TSM_Ratio_Chart.app',
57+
icon=None,
58+
bundle_identifier=None,
59+
)

dist/NVDA_TSM_Ratio_Chart

53.5 MB
Binary file not shown.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDisplayName</key>
6+
<string>NVDA_TSM_Ratio_Chart</string>
7+
<key>CFBundleExecutable</key>
8+
<string>NVDA_TSM_Ratio_Chart</string>
9+
<key>CFBundleIconFile</key>
10+
<string>icon-windowed.icns</string>
11+
<key>CFBundleIdentifier</key>
12+
<string>NVDA_TSM_Ratio_Chart</string>
13+
<key>CFBundleInfoDictionaryVersion</key>
14+
<string>6.0</string>
15+
<key>CFBundleName</key>
16+
<string>NVDA_TSM_Ratio_Chart</string>
17+
<key>CFBundlePackageType</key>
18+
<string>APPL</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>0.0.0</string>
21+
<key>NSHighResolutionCapable</key>
22+
<true/>
23+
</dict>
24+
</plist>
Binary file not shown.
Binary file not shown.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>files</key>
6+
<dict>
7+
<key>Resources/icon-windowed.icns</key>
8+
<data>
9+
eEHOuYpZLB0vKGVIWGZOh5rH8+o=
10+
</data>
11+
</dict>
12+
<key>files2</key>
13+
<dict>
14+
<key>Resources/icon-windowed.icns</key>
15+
<dict>
16+
<key>hash2</key>
17+
<data>
18+
uQo7VuWRab4Phv4EEGmfQsyqFqDIXZgO8OtgaAMvCzY=
19+
</data>
20+
</dict>
21+
</dict>
22+
<key>rules</key>
23+
<dict>
24+
<key>^Resources/</key>
25+
<true/>
26+
<key>^Resources/.*\.lproj/</key>
27+
<dict>
28+
<key>optional</key>
29+
<true/>
30+
<key>weight</key>
31+
<real>1000</real>
32+
</dict>
33+
<key>^Resources/.*\.lproj/locversion.plist$</key>
34+
<dict>
35+
<key>omit</key>
36+
<true/>
37+
<key>weight</key>
38+
<real>1100</real>
39+
</dict>
40+
<key>^Resources/Base\.lproj/</key>
41+
<dict>
42+
<key>weight</key>
43+
<real>1010</real>
44+
</dict>
45+
<key>^version.plist$</key>
46+
<true/>
47+
</dict>
48+
<key>rules2</key>
49+
<dict>
50+
<key>.*\.dSYM($|/)</key>
51+
<dict>
52+
<key>weight</key>
53+
<real>11</real>
54+
</dict>
55+
<key>^(.*/)?\.DS_Store$</key>
56+
<dict>
57+
<key>omit</key>
58+
<true/>
59+
<key>weight</key>
60+
<real>2000</real>
61+
</dict>
62+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
63+
<dict>
64+
<key>nested</key>
65+
<true/>
66+
<key>weight</key>
67+
<real>10</real>
68+
</dict>
69+
<key>^.*</key>
70+
<true/>
71+
<key>^Info\.plist$</key>
72+
<dict>
73+
<key>omit</key>
74+
<true/>
75+
<key>weight</key>
76+
<real>20</real>
77+
</dict>
78+
<key>^PkgInfo$</key>
79+
<dict>
80+
<key>omit</key>
81+
<true/>
82+
<key>weight</key>
83+
<real>20</real>
84+
</dict>
85+
<key>^Resources/</key>
86+
<dict>
87+
<key>weight</key>
88+
<real>20</real>
89+
</dict>
90+
<key>^Resources/.*\.lproj/</key>
91+
<dict>
92+
<key>optional</key>
93+
<true/>
94+
<key>weight</key>
95+
<real>1000</real>
96+
</dict>
97+
<key>^Resources/.*\.lproj/locversion.plist$</key>
98+
<dict>
99+
<key>omit</key>
100+
<true/>
101+
<key>weight</key>
102+
<real>1100</real>
103+
</dict>
104+
<key>^Resources/Base\.lproj/</key>
105+
<dict>
106+
<key>weight</key>
107+
<real>1010</real>
108+
</dict>
109+
<key>^[^/]+$</key>
110+
<dict>
111+
<key>nested</key>
112+
<true/>
113+
<key>weight</key>
114+
<real>10</real>
115+
</dict>
116+
<key>^embedded\.provisionprofile$</key>
117+
<dict>
118+
<key>weight</key>
119+
<real>20</real>
120+
</dict>
121+
<key>^version\.plist$</key>
122+
<dict>
123+
<key>weight</key>
124+
<real>20</real>
125+
</dict>
126+
</dict>
127+
</dict>
128+
</plist>

dist/README.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
NVDA/TSM Ratio Chart Application
2+
==============================
3+
4+
This application displays a real-time chart of the NVDA/TSM price ratio with 1-minute historical data.
5+
6+
Requirements:
7+
------------
8+
1. Interactive Brokers TWS (Trader Workstation) or IB Gateway must be running
9+
2. TWS/Gateway must be configured to accept API connections on port 7497
10+
3. Market data subscriptions for NVDA and TSM
11+
12+
Setup in TWS/Gateway:
13+
-------------------
14+
1. Open TWS/Gateway
15+
2. Go to File -> Global Configuration (or Configure in Gateway)
16+
3. Select "API" -> "Settings" in the left panel
17+
4. Enable "Socket port" and ensure it's set to 7497
18+
5. Check "Enable ActiveX and Socket Clients"
19+
6. Click "Apply" and "OK"
20+
21+
Usage:
22+
------
23+
1. Start TWS/Gateway and log in
24+
2. Double-click NVDA_TSM_Ratio_Chart.exe
25+
3. The chart will automatically:
26+
- Display 100 minutes of historical 1-minute data
27+
- Update every 10 seconds
28+
- Show current local time
29+
4. Close the chart window to exit the application
30+
31+
Features:
32+
--------
33+
- 100-minute historical data with 1-minute bars
34+
- NVDA/TSM price ratio plot
35+
- 20-period moving average
36+
- Real-time statistics (mean, std, min, max)
37+
- Auto-updates every 10 seconds
38+
- Current local time display
39+
40+
Troubleshooting:
41+
--------------
42+
1. If the chart doesn't appear:
43+
- Verify TWS/Gateway is running and logged in
44+
- Check port 7497 is enabled for API connections
45+
- Ensure you have market data permissions for NVDA and TSM
46+
47+
2. If data isn't updating:
48+
- Check your internet connection
49+
- Verify market is open (US market hours)
50+
- Confirm data subscriptions are active in TWS
51+
52+
Note: This application requires an active Internet connection and proper market data subscriptions in your Interactive Brokers account.

0 commit comments

Comments
 (0)