fix: Forex data source improvements and Tiingo subscription hints
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user