fix: Forex data source improvements and Tiingo subscription hints

This commit is contained in:
TIANHE
2026-01-12 04:28:42 +08:00
parent bd5db753df
commit 43523d4796
7 changed files with 157 additions and 17 deletions
+9 -2
View File
@@ -60,10 +60,17 @@ def get_kline():
)
if not klines:
# 针对特定情况给出更详细的提示
msg = 'No data found'
if market == 'Forex' and timeframe == '1m':
msg = 'Forex 1-minute data requires Tiingo paid subscription'
elif market == 'Forex' and timeframe in ('1W', '1M'):
msg = 'No weekly/monthly data available for this period'
return jsonify({
'code': 0,
'msg': 'No data found',
'data': []
'msg': msg,
'data': [],
'hint': 'tiingo_subscription' if (market == 'Forex' and timeframe == '1m') else None
})
return jsonify({
+1 -1
View File
@@ -317,7 +317,7 @@ CONFIG_SCHEMA = {
'required': False,
'link': 'https://www.tiingo.com/account/api/token',
'link_text': 'settings.link.getToken',
'description': 'Tiingo API key for US stock data (free tier available)'
'description': 'Tiingo API key for Forex/Metals data (free tier does not support 1-minute data)'
},
{
'key': 'TIINGO_TIMEOUT',