Comments (6)
https://github.com/shinnytech/open-trade-gateway/blob/master/src/sim/trader_sim.cpp#L116
此段代码的输出
QUANTAXIS>> {'100001': {'session': {'user_id': '100001', 'trading_day': '20190310'}}}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'trade': {'100001': {'session': {'user_id': '100001', 'trading_day': '20190310'}}}}]}
QUANTAXIS>> {'100001': {'user_id': '100001', 'trading_day': '20190310', 'trade_more_data': False, 'accounts': {'CNY': {'user_id': '100001', 'currency': 'CNY', 'pre_balance': 999994.4, 'deposit': 0.0, 'withdraw': 0.0, 'close_profit': 0.0, 'commission': 0.0, 'premium': 0.0, 'static_balance': 999994.4, 'position_profit': -2120.0, 'float_profit': -2120.0, 'balance': 997874.4, 'margin': 16380.0, 'frozen_margin': 0.0, 'frozen_commission': 0.0, 'frozen_premium': 0.0, 'available': 981494.4, 'risk_ratio': 0.016414891493358286}}, 'positions': {'SHFE.rb1905': {'user_id': '100001', 'exchange_id': 'SHFE', 'instrument_id': 'rb1905', 'volume_long_today': 0, 'volume_long_his': 7, 'volume_long': 7, 'volume_long_frozen_today': 0, 'volume_long_frozen_his': 0, 'volume_long_frozen': 0, 'volume_short_today': 0, 'volume_short_his': 0, 'volume_short': 0, 'volume_short_frozen_today': 0, 'volume_short_frozen_his': 0, 'volume_short_frozen': 0, 'open_price_long': 3753.285714285714, 'open_price_short': 0.0, 'open_cost_long': 262730.0, 'open_cost_short': 0.0, 'position_price_long': 3753.285714285714, 'position_price_short': 0.0, 'position_cost_long': 262730.0, 'position_cost_short': 0.0, 'last_price': 3723.0, 'float_profit_long': -2120.0, 'float_profit_short': 0.0, 'float_profit': -2120.0, 'position_profit_long': -2120.0, 'position_profit_short': 0.0, 'position_profit': -2120.0, 'margin_long': 16380.0, 'margin_short': 0.0, 'margin': 16380.0}}, 'orders': {}, 'trades': {}, 'banks': {'SIM': {'id': 'SIM', 'name': '模拟银行'}}, 'transfers': {}}}
from open-trade-gateway.
如果我们联入simnow / 或者实盘账户
输出的trading_day就是正确的
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N0': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '已经连接到交易前置'}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N0': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '已经连接到交易前置'}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N1': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '登录成功'}}}]}
QUANTAXIS>> {'133499': {'session': {'user_id': '133499', 'trading_day': '20190311'}}}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'trade': {'133499': {'session': {'user_id': '133499', 'trading_day': '20190311'}}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N0': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '已经连接到交易前置'}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N1': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '登录成功'}}}]}
QUANTAXIS>> {'133497': {'session': {'user_id': '133497', 'trading_day': '20190311'}}}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'trade': {'133497': {'session': {'user_id': '133497', 'trading_day': '20190311'}}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N0': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '已经连接到交易前置'}}}]}
QUANTAXIS>> {'aid': 'rtn_data', 'data': [{'notify': {'N1': {'type': 'MESSAGE', 'level': 'INFO', 'code': 0, 'content': '登录成功'}}}]}
from open-trade-gateway.
该问题间接导致仓位属性计算错误
应该是今仓/平今
exchange_id: "DCE"
float_profit: 3400
float_profit_long: 0
float_profit_short: 3400
instrument_id: "j1905"
last_price: 1989.5
margin: 11050
margin_long: 0
margin_short: 11050
open_cost_long: 0
open_cost_short: 202350
open_price_long: 0
open_price_short: 2023.5
position_cost_long: 0
position_cost_short: 202350
position_price_long: 0
position_price_short: 2023.5
position_profit: 3400
position_profit_long: 0
position_profit_short: 3400
user_id: "100003"
volume_long: 0
volume_long_frozen: 0
volume_long_frozen_his: 0
volume_long_frozen_today: 0
volume_long_his: 0
volume_long_today: 0
volume_short: 1
volume_short_frozen: 1
volume_short_frozen_his: 0
volume_short_frozen_today: 0
volume_short_his: 1
volume_short_today: 0
from open-trade-gateway.
@shinny-yangyang @shinny-chengzhi
from open-trade-gateway.
bug confirmed.
open-trade-gateway/src/utility.cpp
Line 31 in e4c83bd
此函数在周末白天执行时, 会算错下一个交易日
from open-trade-gateway.
@shinny-yangyang thx
from open-trade-gateway.
Related Issues (20)
- m_notify_seq 可能会重复
- ClearOldData 的调用时机是否正确
- 平仓后,持仓均价、开仓均价未清零 HOT 1
- 条件单开盘触发重复下单 HOT 1
- 行情连接开启压缩
- 股指合约夜盘时盈亏计算有问题,目前最新价收的是昨收盘,应该是按昨结算计算 HOT 1
- 增加持仓、委托单字段 HOT 1
- 银期签约增加查询功能
- LOG中有巨量的md message. 是否能加入调整log level的功能? HOT 1
- 组合合约的开盘触发建议过滤去集合竞价的时间点,因组合合约集合竞价不能报单
- notify中部分通知增加一些信息
- 设法消去对单号映射表的依赖
- 提升CPU效能,使相同CPU资源可以支持更多用户数
- 对接新版合约服务
- 期权持仓的浮动盈亏, 持仓盈亏错误, 导致账户权益也错误 HOT 1
- 不要混用状态文件和配置文件
- 条件单日志记录的用户密码需改为密文形式
- 大佬,咨询两点 HOT 2
- 有个问题请教下您,子服务进程crash问题!
- stopprocess 貌似会产生很多僵尸进程,是不是先detach,然后再kill?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-trade-gateway.