[备注] 更新
This commit is contained in:
parent
c499bd929a
commit
2d8d61cc91
@ -19,6 +19,8 @@
|
||||
7. 增加App: cta_strategy_pro,包括:
|
||||
|
||||
- 提供cta_line_bar k线组件,支持国内文华/交易师/TB等分钟/小时的计算模式,支持任意秒/分钟/小时/天/周等周期,支持k线数据实时生成。
|
||||
- 提供cta_renko_bar k线组件,支持x跳动/千分比跳动 【特定开源对象】
|
||||
- 提供cta_fund_kline 资金曲线组件,策略实例/账号基本的实时资金曲线 【特定开源对象】
|
||||
- 提供cta_position 组件,支持多/空/净仓位记录,支持套利
|
||||
- 提供cta_policy 组件,持久化复杂的策略执行逻辑
|
||||
- 提供cta_period 组件,支持策略中‘周期’的逻辑
|
||||
@ -27,6 +29,8 @@
|
||||
- 去除统一的策略数据持久化功能,改为策略内部自行实现。
|
||||
- 去除加载k线/tick初始化服务,改为策略内部自行实现。
|
||||
- 提供单独重启某一策略实例功能,可在线更新策略源码后,重启某一策略实例,不影响其他运行实例。
|
||||
- 支持单策略多合约行情订阅,支持指数合约行情订阅
|
||||
|
||||
大佳
|
||||
QQ/Wechat:28888502
|
||||
|
||||
|
@ -13,6 +13,7 @@ TDX_FUTURE_CONFIG = 'tdx_future_config.json'
|
||||
# 股票的配置文件
|
||||
TDX_STOCK_CONFIG = 'tdx_stock_config.pkb2'
|
||||
|
||||
|
||||
@lru_cache()
|
||||
def get_tdx_market_code(code):
|
||||
# 获取通达信股票的market code
|
||||
@ -74,6 +75,7 @@ def get_future_contracts():
|
||||
"""获取期货合约信息"""
|
||||
return get_cache_json('future_contracts.json')
|
||||
|
||||
|
||||
def save_future_contracts(future_contracts_dict: dict):
|
||||
"""保存期货合约信息"""
|
||||
save_cache_json(future_contracts_dict, 'future_contracts.json')
|
||||
|
@ -13,11 +13,10 @@ import os
|
||||
import pickle
|
||||
import bz2
|
||||
import copy
|
||||
import json
|
||||
import traceback
|
||||
|
||||
from datetime import datetime, timedelta, time
|
||||
from logging import ERROR, INFO
|
||||
from logging import ERROR
|
||||
from typing import Dict
|
||||
|
||||
from pandas import to_datetime
|
||||
@ -729,7 +728,8 @@ class TdxFutureData(object):
|
||||
|
||||
mi_contract_quote_list = self.get_mi_contracts2()
|
||||
|
||||
self.write_log(u'一共获取:{}个主力合约:{}'.format(len(mi_contract_quote_list), [c.get('code') for c in mi_contract_quote_list]))
|
||||
self.write_log(
|
||||
u'一共获取:{}个主力合约:{}'.format(len(mi_contract_quote_list), [c.get('code') for c in mi_contract_quote_list]))
|
||||
should_save = False
|
||||
# 逐一更新主力合约数据
|
||||
for mi_contract in mi_contract_quote_list:
|
||||
@ -743,7 +743,8 @@ class TdxFutureData(object):
|
||||
mi_symbol = get_real_symbol_by_exchange(full_symbol, vn_exchange)
|
||||
|
||||
# 更新登记 短合约:真实主力合约
|
||||
self.write_log('{},{},{},{},{}'.format(tdx_market_id, full_symbol, underlying_symbol, mi_symbol, vn_exchange))
|
||||
self.write_log(
|
||||
'{},{},{},{},{}'.format(tdx_market_id, full_symbol, underlying_symbol, mi_symbol, vn_exchange))
|
||||
if underlying_symbol in self.future_contracts:
|
||||
info = self.future_contracts.get(underlying_symbol)
|
||||
if mi_symbol > info.get('mi_symbol'):
|
||||
|
Loading…
Reference in New Issue
Block a user