[StockName, StockQuantity, StockOpenPositionPrice, StockCost, StockProfitLoss, StockCurrentPrice, PortfolioEmpty, PortfolioChanged] = PortfolioIB(Port, 8, true)
✅ Local Lock Acquired: IBTWS (Session 8015)
✅ Local Lock Acquired: ===> IBTWS IBTWSBooking <=== other computers have to wait now …
We have now booked the TWS, it has taken about 3 seconds to open the booking !
Reusing connection to TWS via IP: 127.0.0.1
……….Buffer stabilized with 1 entries in 3.5 seconds
Received 33 positions (showing first 2):
DHT 0 0.0
FTI 0 0.0
Processed 33 raw positions into 15 unique positions
Fetching price data for each of the stocks one by one, please wait …
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
=== Done ===
Portfolio Positions:
Type Stock Quantity AvgPrice CurPrice MarketValue P&L P&L %%
—————————————————————————————————-
LONG AMPX 474 10.49 10.46 4,960 -14 -0.3%
LONG APLD 177 28.22 27.92 4,942 -53 -1.1%
LONG BB 602 8.31 8.36 5,033 +29 +0.6%
LONG DELL 11 467.19 465.88 5,125 -14 -0.3%
LONG DT 93 53.61 53.12 4,940 -46 -0.9%
LONG ENVX 1412 3.54 3.54 4,998 -5 -0.1%
LONG FLEX 44 115.12 115.46 5,080 +15 +0.3%
LONG FNGU 155 32.49 32.44 5,028 -8 -0.1%
LONG GLW 33 151.63 152.00 5,016 +12 +0.2%
LONG PLTR 27 184.45 184.68 4,986 +6 +0.1%
LONG SMH 9 569.51 568.41 5,116 -10 -0.2%
LONG SOXL 41 121.24 120.95 4,959 -12 -0.2%
LONG SOXX 10 522.65 521.90 5,219 -8 -0.1%
LONG VRT 19 264.71 264.20 5,020 -10 -0.2%
LONG ZETA 504 29.65 29.70 14,969 +24 +0.2%
—————————————————————————————————-
PORTFOLIO SUMMARY:
—————–
Position Counts:
Long Positions: 15 stocks, 3611 shares
Short Positions: 0 stocks, 0 shares
Total Positions: 15 stocks, 3611 net shares
Market Values:
Long Market Value: $ 85,391
Short Market Value: $ 0
Net Market Value: $ 85,391
Gross Market Value: $ 85,391
Profit & Loss:
Total P&L: $ -92
Total Return: -0.11%
Long Return: -0.11% (P&L: $-92)
Return on Gross: -0.11%
Note: Prices fetched from latest stored data files
✅ Local Lock Acquired: U8933912IB20260827113007 (Session 8015)
✅ Local Lock Acquired: ===> U8933912IB20260827113007 U8933912IB20260827113149 Portfolio >
Data downloading is OK, but NOT for this instrument, try again! cel
No Liquidity data is found !
Failed to fetch data for ticker CEL
Marking CEL for exclusion (liquidity: 0, digits: 0)
Processing ticker CELT (499/500)
New York time is 13:39 <——-<———->—–>
New York time is 13:39 <——-<———->—–>
1000001 200 No security definition has been found for the request
Checking the network and IB TWS data transmission status.
Data streaming from IB TWS API is OK!
-1 501 Already connected.
-1 501 Already connected.
Data downloading is OK, but NOT for this instrument, try again! celt
Checking the network and IB TWS data transmission status.
Data streaming from IB TWS API is OK!
-1 501 Already connected.
-1 501 Already connected.
Data downloading is OK, but NOT for this instrument, try again! celt
No Liquidity data is found !
Failed to fetch data for ticker CELT
Marking CELT for exclusion (liquidity: 0, digits: 0)
Processing ticker CENN (500/500)
New York time is 13:40 <——-<———->—–>
New York time is 13:40 <——-<———->—–>
Marking CENN for exclusion (liquidity: 4.2843, digits: 0)
=== PROCESS BATCH RESULTS ===
Processed: 358/500 tickers
toInclude: 2 tickers
Tickers to include: BTCZ, CABA
Processing results: 358 succeeded
Updated status for 358 items to “completed”
New York time is 13:41 <——-<———->—–>
List to be reviewed : exclusiveDataFetching
Debug: Main list size: 14435
Debug: Status field size: 15320
Debug: Difference: -14435 items
Data consistency check complete. Total tickers: 15320, status: 15320, claimedBy: 15320, claimTime: 15320
=== ENSURING DATA CONSISTENCY ===
DEBUG: localFolder = /Volumes/BarnUniJahr/StockPrograms/rawdata/StockListsUS
Data consistency ensured – using current file state
After save – BTCZ: inclusive=0, exclusive=1 ❌
After save – CABA: inclusive=0, exclusive=1 ❌
Exclusive list: uploading because toInclude has 2 items
[13:41:02] Starting updateAndUpload for exclusiveDataFetching (List: DataFetching)
=== SIMPLIFIED MERGE & UPLOAD ===
📥 Downloading latest server file with merge (DownLoad=10)…
Creating FTP connection for lock acquisition for: StockListsUS
FTP connection successful on attempt 1
Creating ftp lock file: GLOBAL_StockListsUS_ComputerID8015_20260824134104.lock
We are now using the ftp server for this stock : ===> StockListsUS <=== other computers have to wait now …
We have now booked the ftp server, it has taken about 4 seconds to open the booking !
FTP connection successful on attempt 1
Successfully downloaded StockListsUS.mat from the ftp server to local computer !
🔧 Final release – ensuring all locks from computer 8015 are cleaned up…
Deleted lock file: GLOBAL_StockListsUS_ComputerID8015_20260824134104.lock
✅ Released 1 lock files
We have now released the ftp server booking, it has taken 3 seconds to release it !
lockDepth = 0 in ftpBooking around line 130.
Global ftp lock released for StockListsUS.mat
Successfully uploaded to the ftp server, and the lock file will soon be released.
Done with the ftp transaction, it has taken 18 seconds or about 0 minutes to transfer the file File Name Here .
✅ Successfully downloaded and merged server data
inclusiveDataFetching: 885 items
exclusiveDataFetching: 14435 items
📝 Applying our local changes to merged data…
Processing exclusive list:
– Moving 2 tickers from exclusive → inclusive (passed)
– Keeping 498 tickers in exclusive (failed)
📊 Verifying changes…
✅ BTCZ: correctly in inclusive
✅ CABA: correctly in inclusive
💾 Saving merged data locally…
Before atomicSave: DIT in inclusive? 0
Before atomicSave: DIT in exclusive? 1
Before atomicSave: file path = /Volumes/BarnUniJahr/StockPrograms/rawdata/StockListsUS/StockListsUS.mat
After atomicSave: DIT in inclusive? 0
After atomicSave: DIT in exclusive? 1
% —- DEBUG: Check file immediately after save —-
testData = load(localFile);
fprintf(‘After atomicSave: DIT in inclusive? %d\n’, any(strcmpi(testData.inclusiveDataFetching, ‘DIT’)));
fprintf(‘After atomicSave: DIT in exclusive? %d\n’, any(strcmpi(testData.exclusiveDataFetching, ‘DIT’)));
After atomicSave: DIT in inclusive? 0
After atomicSave: DIT in exclusive? 1
[StockName, StockQuantity, StockOpenPositionPrice, StockCost, StockProfitLoss, StockCurrentPrice, PortfolioEmpty, PortfolioChanged] = PortfolioIB(Port, 8, true)
✅ Local Lock Acquired: IBTWS (Session 8015)
✅ Local Lock Acquired: ===> IBTWS IBTWSBooking <=== other computers have to wait now …
We have now booked the TWS, it has taken about 3 seconds to open the booking !
Reusing connection to TWS via IP: 127.0.0.1
……….Buffer stabilized with 1 entries in 3.5 seconds
Received 33 positions (showing first 2):
DHT 0 0.0
FTI 0 0.0
Processed 33 raw positions into 15 unique positions
Fetching price data for each of the stocks one by one, please wait …
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
✗ File not found: /Volumes/BarnUniJahr/StockPrograms/rawdata/rawdatatemp/ampx.mat
New York time is 11:31 <——-<———->—–>
=== Done ===
PORTFOLIO SNAPSHOT
===================
Account: U8933912IB
Date: 20260827113149
Timestamp: 27-Aug-2026 11:31:49
Portfolio Positions:
Type Stock Quantity AvgPrice CurPrice MarketValue P&L P&L %%
—————————————————————————————————-
LONG AMPX 474 10.49 10.46 4,960 -14 -0.3%
LONG APLD 177 28.22 27.92 4,942 -53 -1.1%
LONG BB 602 8.31 8.36 5,033 +29 +0.6%
LONG DELL 11 467.19 465.88 5,125 -14 -0.3%
LONG DT 93 53.61 53.12 4,940 -46 -0.9%
LONG ENVX 1412 3.54 3.54 4,998 -5 -0.1%
LONG FLEX 44 115.12 115.46 5,080 +15 +0.3%
LONG FNGU 155 32.49 32.44 5,028 -8 -0.1%
LONG GLW 33 151.63 152.00 5,016 +12 +0.2%
LONG PLTR 27 184.45 184.68 4,986 +6 +0.1%
LONG SMH 9 569.51 568.41 5,116 -10 -0.2%
LONG SOXL 41 121.24 120.95 4,959 -12 -0.2%
LONG SOXX 10 522.65 521.90 5,219 -8 -0.1%
LONG VRT 19 264.71 264.20 5,020 -10 -0.2%
LONG ZETA 504 29.65 29.70 14,969 +24 +0.2%
—————————————————————————————————-
PORTFOLIO SUMMARY:
—————–
Position Counts:
Long Positions: 15 stocks, 3611 shares
Short Positions: 0 stocks, 0 shares
Total Positions: 15 stocks, 3611 net shares
Market Values:
Long Market Value: $ 85,391
Short Market Value: $ 0
Net Market Value: $ 85,391
Gross Market Value: $ 85,391
Profit & Loss:
Total P&L: $ -92
Total Return: -0.11%
Long Return: -0.11% (P&L: $-92)
Return on Gross: -0.11%
Note: Prices fetched from latest stored data files
✅ Local Lock Acquired: U8933912IB20260827113007 (Session 8015)
✅ Local Lock Acquired: ===> U8933912IB20260827113007 U8933912IB20260827113149 Portfolio >
Data downloading is OK, but NOT for this instrument, try again! cel
No Liquidity data is found !
Failed to fetch data for ticker CEL
Marking CEL for exclusion (liquidity: 0, digits: 0)
Processing ticker CELT (499/500)
New York time is 13:39 <——-<———->—–>
New York time is 13:39 <——-<———->—–>
1000001 200 No security definition has been found for the request
Checking the network and IB TWS data transmission status.
Data streaming from IB TWS API is OK!
-1 501 Already connected.
-1 501 Already connected.
Data downloading is OK, but NOT for this instrument, try again! celt
Checking the network and IB TWS data transmission status.
Data streaming from IB TWS API is OK!
-1 501 Already connected.
-1 501 Already connected.
Data downloading is OK, but NOT for this instrument, try again! celt
No Liquidity data is found !
Failed to fetch data for ticker CELT
Marking CELT for exclusion (liquidity: 0, digits: 0)
Processing ticker CENN (500/500)
New York time is 13:40 <——-<———->—–>
New York time is 13:40 <——-<———->—–>
Marking CENN for exclusion (liquidity: 4.2843, digits: 0)
=== PROCESS BATCH RESULTS ===
Processed: 358/500 tickers
toInclude: 2 tickers
Tickers to include: BTCZ, CABA
Processing results: 358 succeeded
Updated status for 358 items to “completed”
New York time is 13:41 <——-<———->—–>
List to be reviewed : exclusiveDataFetching
Debug: Main list size: 14435
Debug: Status field size: 15320
Debug: Difference: -14435 items
Data consistency check complete. Total tickers: 15320, status: 15320, claimedBy: 15320, claimTime: 15320
=== ENSURING DATA CONSISTENCY ===
DEBUG: localFolder = /Volumes/BarnUniJahr/StockPrograms/rawdata/StockListsUS
Data consistency ensured – using current file state
After save – BTCZ: inclusive=0, exclusive=1 ❌
After save – CABA: inclusive=0, exclusive=1 ❌
Exclusive list: uploading because toInclude has 2 items
[13:41:02] Starting updateAndUpload for exclusiveDataFetching (List: DataFetching)
=== SIMPLIFIED MERGE & UPLOAD ===
📥 Downloading latest server file with merge (DownLoad=10)…
Creating FTP connection for lock acquisition for: StockListsUS
FTP connection successful on attempt 1
GLOBAL_CombinedPortfolioRanking_ComputerID2003_20260824134044.lock
GLOBAL_IBTWSBooking_.lock
GLOBAL_IBTWSBooking_ComputerID8002_20260824133834.lock
GLOBAL_TopStocksUS1_temp_20260824133514_ComputerID7005_20260824133638.lock
Creating ftp lock file: GLOBAL_StockListsUS_ComputerID8015_20260824134104.lock
We are now using the ftp server for this stock : ===> StockListsUS <=== other computers have to wait now …
We have now booked the ftp server, it has taken about 4 seconds to open the booking !
FTP connection successful on attempt 1
Downloading………………….. StockListsUS.mat…………………………..
Remote file size: 138391 bytes
Download verified: StockListsUS.mat (size: 138391 bytes)
Successfully downloaded StockListsUS.mat
Successfully processed /Volumes/BarnUniJahr/StockPrograms/rawdata/StockListsUS/StockListsUS.mat
Applying Smart Merge with Meta-Status priority…
Data fingerprints match – skipping merge
✅ Smart merge completed successfully.
Successfully downloaded StockListsUS.mat from the ftp server to local computer !
🔧 Final release – ensuring all locks from computer 8015 are cleaned up…
Deleted lock file: GLOBAL_StockListsUS_ComputerID8015_20260824134104.lock
✅ Released 1 lock files
We have now released the ftp server booking, it has taken 3 seconds to release it !
lockDepth = 0 in ftpBooking around line 130.
Global ftp lock released for StockListsUS.mat
Successfully uploaded to the ftp server, and the lock file will soon be released.
Done with the ftp transaction, it has taken 18 seconds or about 0 minutes to transfer the file File Name Here .
✅ Successfully downloaded and merged server data
inclusiveDataFetching: 885 items
exclusiveDataFetching: 14435 items
📝 Applying our local changes to merged data…
Processing exclusive list:
– Moving 2 tickers from exclusive → inclusive (passed)
– Keeping 498 tickers in exclusive (failed)
📊 Verifying changes…
✅ BTCZ: correctly in inclusive
✅ CABA: correctly in inclusive
💾 Saving merged data locally…
Before atomicSave: DIT in inclusive? 0
Before atomicSave: DIT in exclusive? 1
Before atomicSave: file path = /Volumes/BarnUniJahr/StockPrograms/rawdata/StockListsUS/StockListsUS.mat
After atomicSave: DIT in inclusive? 0
After atomicSave: DIT in exclusive? 1
% —- DEBUG: Check file immediately after save —-
testData = load(localFile);
fprintf(‘After atomicSave: DIT in inclusive? %d\n’, any(strcmpi(testData.inclusiveDataFetching, ‘DIT’)));
fprintf(‘After atomicSave: DIT in exclusive? %d\n’, any(strcmpi(testData.exclusiveDataFetching, ‘DIT’)));
After atomicSave: DIT in inclusive? 0
After atomicSave: DIT in exclusive? 1