win: add ctp subsystem

Add Comprehensive Transaction Platform subsystem.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add API from lovelylain's project

1) Add API from lovelylain's project.
2) Remove backward API.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add mdmap module

Add Market Data Map support.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add ctpapi module

1) Add ctpapi module.
2) Add API to CTP Market Data (CtpMdApi).

Merged zw-dev from a03ee88ef to 34f4ea752.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add ctpagent module

1) Add ctpagent module.
2) Add Market Data Agent (MarketDataAgent).

Merged zw-dev from a03ee88ef to 34f4ea752.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add testctp module

Add local test module testctp to accelerate testing to ctp.

Merged zw-dev from a03ee88ef to 34f4ea752.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:mdmap: fix the stored objects were used outside mdmap

1) Fix the stored objects were used outside market data map.
2) Add new method isMdDataExisted().

Merged zw-dev from 2034b503a to ea518845c.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpagent: update market data agent

1) Update OnRtnDepthMarketData() to map market data to data mapping.
2) Fix arguments order in initAgent().

Merged zw-dev from 2034b503a to ea518845c.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add testmd.py module

Test to Market Data Map.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpapi: add ctp trader api

Add ctp trader api class (CtpTraderApi).

Merged zw-dev from 76ed554550 to 5f5d216119.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:testctp: add test to ctp trader api

1) Add test to ctp trader api.
2) Rename doTest() to testMdApi().

Merged zw-dev from 76ed554550 to 5f5d216119.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:testctp: update server/ports, etc

Update server and port using scqh.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpagent: add trader agent support

Add trader agent support (TraderAgent).

Merged zw-dev from ac9df317d22 to 2dde75f1f0d.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpapi: enable agent support for trader api

1) Enable agent support for trader api.
2) Add open_position() to open positions.

Merged zw-dev from ac9df317d22 to 2dde75f1f0d.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:testctp: add test to TraderAgent

1) Add test to TraderAgent.
2) Devide testing into md and td tests.

Merged zw-dev from ac9df317d22 to 2dde75f1f0d.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpapi: add support to close positions

1) Add close_position() to close positions.
2) Add and update runtime logs for debugging.

Merged zw-dev from a0e0d74ea to c55650a39.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpagent: add support to close positions

1) Add close_position() to close positions.
2) Add inc_order_ref() and other api callbacks.

Merged zw-dev from a0e0d74ea to c55650a39.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp: add error.xml for development

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpapi: fix open_position() not working

1) Fix open_position() not working by adding ContingentCondition.
2) Enable log support by initializing logging basic.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>
ctp:ctpapi/ctpagent: fix close_position() not working

1) Fix issue that can not close positions.
2) Chose OF_Close as default flag to close positions.

Signed-off-by: Zhengwang Ruan <ruan.zhengwang@gmail.com>