Coder Social home page Coder Social logo

ctpsharp's Introduction

CTPSharp

C#版CTP交易和行情接口类库,在原基础上进行二次封装,支持32位和64位自适应,支持多账户多实例,入参和出参全部使用C#实体类,返回结果支持MVVM绑定。 x86和amd64文件夹内的文件为MdApi.dll、TradeApi.dll、thostmduserapi.dll、thosttraderapi.dll,需要将这两个文件夹复制到当前程序文件夹。

CTP版本6.3.16_20190305 看穿式监管版查看分支ctpse

使用说明

该项目派生自 https://github.com/yajiedesign/CTPCSharp

ctpsharp's People

Contributors

minifatboy avatar nonultimate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctpsharp's Issues

执行回调函数后,网络连接断开

在快期下单成交,回调函数执行了
public void RtnTrade(ref CThostFtdcTradeField pTrade)
{
Console.WriteLine("成交查询成功, TradeID: {0}", pTrade.TradeID);
}
但是执行完后,网络就断开了,执行了下面的回调,nReasion是4097,这是什么原因?
_api.OnDisconnected += new TradeApi.Disconnected((int nReasion) =>
{
_isConnected = false;
});

升级成6.6.1之后的问题

不太懂C++,只是简单替换文件,和修复编译错误。但是WPF调用时,退出总是报这个错误,不知道怎么处理。

希望作者继续更新,我可以捐些款

问题签名:
问题事件名称: BEX
应用程序名: AutoFutures.Wpf.exe
应用程序版本: 1.0.0.0
应用程序时间戳: c354b336
故障模块名称: thostmduserapi_se.dll_unloaded
故障模块版本: 0.0.0.0
故障模块时间戳: 606bb06b
异常偏移: 0f36fa00
异常代码: c0000005
异常数据: 00000008
OS 版本: 6.1.7601.2.1.0.256.1
区域设置 ID: 2052
其他信息 1: be7b
其他信息 2: be7b94eb5da661025c613c2e758ff9e4
其他信息 3: be7b
其他信息 4: be7b94eb5da661025c613c2e758ff9e4

多账户登录有问题

楼主您好,我目前在用websocket+ctp 来做模拟交易,
我发现不同的用户登录交易,他们会互踢,假如a先登录,然后b登录,最后登录的b会踢掉先前登录的a。
你有这种情况吗?

调用取所有合约的接口取到合约不全

请教个问题,调用ctp获取所有合约_trader.QueryInstrument(1);,但是合约获取的不全,像IC,只取到了IC1912和IC2001,其他IC的没有,包括期权的,只取到九百多条,有可能是什么原因?谢谢

当在 amd64 环境下调用收集数据方法时有异常,我参考了别人的代码更改如下并测试通过

文件路径为:\CTPSharp\CTPTradeApi\DataCollect.cs

public DataCollect()
{
    try
    {
        string path = Path.GetFullPath(string.Format("{0}\\{1}", LibraryWrapper.ProcessorArchitecture,
                DllName));
        _wrapper = new LibraryWrapper(path);

        if(LibraryWrapper.ProcessorArchitecture == "x86") {
            getSystemInfo = _wrapper.GetUnmanagedFunction<DelegateGetSystemInfo>("?CTP_GetSystemInfo@@YAHPADAAH@Z");
        } else {
            getSystemInfo = _wrapper.GetUnmanagedFunction<DelegateGetSystemInfo>("?CTP_GetSystemInfo@@YAHPEADAEAH@Z");
        }
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

trade dll probleams.

System.Exception:“Failed to get unmanaged function for name: ?CTP_GetSystemInfo@@YAHPADAAH@Z”

then,how can i do next. do you have some contract ways?

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.