Giter VIP home page Giter VIP logo

java-trader's Issues

希望能建立<合约详情数据库>

希望能建立<合约详情数据库>,用于复杂回测(期货主力合约回测,期权回测等)

参考:
CTP合约信息API
https://www.vnpy.com/forum/topic/4358

TdApi.reqQryInstrument()函数,返回的部分字段(顺序有调整):
{
//-----------------------------------以下是<合约详情>,固定的----可以写入数据库中!
'InstrumentID': 'rb2010',
'ExchangeID': 'SHFE',
'InstrumentName': '螺纹钢2010',
'ExchangeInstID': 'rb2010',
'ProductID': 'rb',
'ProductClass': '1',

'UnderlyingInstrID': '', 
'StrikePrice': 0.0, 
'OptionsType': '\x00', 
'UnderlyingMultiple': 0.0, 


'VolumeMultiple': 10, 
'PriceTick': 1.0, 


'DeliveryYear':	2020, 
'DeliveryMonth':	10, 

'CreateDate':	'20190912', 
'OpenDate':		'20191016', 
'ExpireDate':	'20201015', 

'StartDelivDate':	'20201016', 
'EndDelivDate':	'20201022', 

//-----------------------------------以下是状态量,变化的----也可以入库,但分成多条记录入库!
'IsTrading': 1, 
'InstLifePhase': '1',			

'MaxMarketOrderVolume': 30, 
'MinMarketOrderVolume': 1, 
'MaxLimitOrderVolume': 500, 
'MinLimitOrderVolume': 1, 

'LongMarginRatio': 0.1, 
'ShortMarginRatio': 0.1, 

'MaxMarginSideAlgorithm': '1', 


'PositionType': '2', 
'PositionDateType': '1', 


'CombinationType': '0'

}

希望能够考虑回测场景

回测场景
eg:
股票:订阅指定板块的个股,个股会随着时间变化,尽管是缓慢变化的
期货:订阅指数合约同时订阅主力合约,主力合约随着时间变化
支持在期货指数数据上进行策略运算,在主力合约上下单
期权:往往只需要指定标的资产/到期月份,就可以订阅一系列期权合约,也是随着时间变化的

标的的动态订阅/退订,用于回测&实盘
尤其是期权回测,标的必须能动态变更,而不是在开始的时候就固定不变

批量订阅----回测/实盘时,根据<标的Filter规则>和<实际可订阅标的列表>来

退订分为:
	a.自动退订(标的到期or退市)
	b.主动退订(满足某些条件,该标的不具有再开仓的价值了,可退订,eg:持有的头寸平仓,不再交易该标的了;期货标的接近交割月,可退订;...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.