The connector uses ThetaData API v2, which Theta Terminal v3 rejects with HTTP 410
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by tracing ThetaDataRestApiClient.ApiVersion, the REST request models and v2 response converters, and the option chain provider; the issue names these as the affected areas but gives no file paths. Compare their behavior with the v3 paths, parameters, response format, status codes, and date limits described here. Reproduce against Theta Terminal v3, including the Free plan contract list denial. Done means history, downloads, backtests, research, and option chain retrieval work with v3; the issue reports an unmerged pull request with related changes and tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Expected Behavior
History requests, lean data download, backtests, and research return ThetaData data when Theta Terminal is running.
Actual Behavior
Every request fails. The connector calls API v2 (ThetaDataRestApiClient.ApiVersion = "/v2", default thetadata-rest-url http://127.0.0.1:25510). Theta Terminal v3 listens on port 25503 and answers every v2 path with:
HTTP 410
We have upgraded to API v3. Please use API v3 instead. Update your endpoint URLs to /v3/* format. Consult API v3 documentation for more information: https://thetadata.net/docs/
Changing the port and the version prefix is not enough. v3 also changed:
- the paths, for example
hist/option/eodis nowoption/history/eod, andlist/contracts/option/quoteis nowoption/list/contracts/quote; - the parameter names and units:
rootis nowsymbol,expis nowexpiration, the strike is in dollars (470.000, not470000), the right iscall/put, andivl(milliseconds) is nowinterval(1m,1h); - the response: CSV by default, or JSON with
format=json, with named fields and ISO timestamps instead of positional arrays. Theheader.next_pagefield is gone; - the plan denial: HTTP 403 with a text body;
- the date range limits: 1 day for an interval under 1 minute, 1 month for 1 minute or more, and 365 days without an interval (HTTP 400 "Too many days between start and end date; max 365 days allowed").
So the v2 converters cannot parse any v3 response.
On the Free plan, option/list/contracts/* also returns HTTP 403 ("requiring a value subscription"), so the option chain provider gets no contracts even with a v3 URL. The end-of-day endpoint with expiration=* is allowed on the Free plan and lists the whole chain of a day.
The thetadata-rest-url default in the CLI module list is also the v2 port: http://host.docker.internal:25510.
Potential Solution
Move the REST client and models to v3: the v3 paths and parameters, format=json, typed row models, the v3 status codes, and the v3 date range limits. For the Free plan, list the option chain from the end-of-day report when the contract list is denied. Change the CLI module default of thetadata-rest-url to port 25503.
I have a branch with these changes and tests on recorded v3 responses, and can open a pull request.
Reproducing the Problem
- Start Theta Terminal v3 (
java -jar ThetaTerminalv3.jar) and log in. - Request any v2 path:
The first fails to connect. The second returns HTTP 410 with the text above.curl -i "http://127.0.0.1:25510/v2/list/roots/option" curl -i "http://127.0.0.1:25503/v2/list/roots/option" - The v3 path works:
curl "http://127.0.0.1:25503/v3/stock/history/eod?symbol=SPY&start_date=20261020&end_date=20261020&format=json"
System Information
- Windows 11, Docker Desktop, LEAN CLI, LEAN engine built from master of 2026-10-16
- Theta Terminal v3, Free plan, checked on 2026-10-28
- Connector at
masterd9e4e04
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
- Ngôn ngữ chính
- C#
- Star
- 24
- Fork
- 16
- Merge trung bình
- 7 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QuantConnect/Lean.DataSource.ThetaData
-
priority:P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Unsupported SecurityType 'Option' for symbol '?SPY'Có thể làm lại được @Romazes đã nhận 636 ngày trước và không có pull request nào đang mở. Đang mở
QuantConnect/Lean.DataSource.ThetaData#12 · 1 bình luận · 1 reaction · 1 người được giao ·
-
History Request: Option: missed empty barsCó thể làm lại được @Romazes đã nhận 647 ngày trước và không có pull request nào đang mở. Đang mởbug
QuantConnect/Lean.DataSource.ThetaData#11 · 1 người được giao ·
-
Empty Option Contracts Returned if Invoked inside the Lean Environment (both Backtest and Research)Có thể làm lại được @Romazes đã nhận 651 ngày trước và không có pull request nào đang mở. Đang mở
QuantConnect/Lean.DataSource.ThetaData#9 · 4 bình luận · 1 người được giao ·
Tất cả issue của QuantConnect/Lean.DataSource.ThetaData
Issue tương tự
-
bug priority:low severity:S3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
squid-farm/talewright#909 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
kronos:develop:queued priority:P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày