Delphi 的 FIX 协议引擎?
谁能推荐一个与 Delphi 一起使用的 FIX 引擎(商业或开源)?
是否可以将 QuickFIX 与 Delphi 一起使用?
Can anyone recommend a FIX Engine (commercial or open source) for use with Delphi?
Is it possible to use QuickFIX with Delphi?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看B2BITS FIX 天线。有两个可能的选项:
http://www.b2bits.com/trading_solutions/fix_engines/fix_engine_cpp.html
http://www.b2bits.com/trading_solutions/fix_engines/fix_enginenet.html
如果您需要更多,请随时直接与我联系 细节。
Take a look at B2BITS FIX Antenna. There are two possible options:
http://www.b2bits.com/trading_solutions/fix_engines/fix_engine_cpp.html
http://www.b2bits.com/trading_solutions/fix_engines/fix_enginenet.html
Feel free to contact me directly if you need more details.
QuickFix 是一个 C++ 项目。
Python 和 Ruby 都使用 SWIG 将 C++ 类公开为本机 Python 和 Ruby 类。
.NET 包装器听起来像是 C++ 和 C# 代码的混合体。
无法直接在 Delphi 中导入 C++ 类。您必须使用“平面 API”转换,将所有 C++ 方法公开为纯 C 声明,以便在 Delphi 单元中导入外部结构和函数。
据我所知,QuickFIX 没有这样的“平面 API”可用,也没有 SWIG 版本能够生成 Delphi 代码。您必须用 C++ 编写您自己的包装器,或者也许用 Delphi 编写您自己的 FIX 实现。
我所知道的 Delphi 唯一的 FIX 库是来自 http://www.b2bits.com 的库 - 它确实存在几年前,但我不确定它是否仍然出售/维护 - 他们似乎只维护 DotNet 版本。在所有情况下,都值得向他们询问定价和供货情况。
QuickFix is a C++ project.
Both Python and Ruby use SWIG to expose the C++ classes as native Python and Ruby classes.
The .NET wrapper sounds like a mix of C++ and C# code.
It's not possible to import C++ classes within Delphi directly. You'll have to use a "flat API" conversion, exposing all C++ methods as plain C declarations, in order to import external structures and functions in a Delphi unit.
To my knowledge, there is no such "flat API" of QuickFIX available, and no SWIG version able to generate Delphi code. You'll have to write your own wrapper in C++, or perhaps write your own FIX implementation in Delphi.
The only FIX library I know for Delphi is the one from http://www.b2bits.com - it did exist some years ago, but I'm not sure it's still sold/maintained - they seems to maintain only a DotNet version. Worth asking them for pricing and availability, in all cases.
将协议与 Delphi 集成的一种方法是构建一个 .Net 或 Java 桥,例如:
One way to integrate the protocol with Delphi would be building a .Net or Java bridge, for example:
这可能比其他任何东西都更像是一种黑客攻击,但是您可以通过 python4delphi。不过,这是很多层(Delphi 到 Python 到 C++)。
Python 是一种易于使用和学习的语言,并且可以轻松调用和创建 Python 对象(或伪装成 Python 对象的本机 C 包装器)并直接从 Python4Delphi API 调用它们。
除此之外,正如 ABouchez 所说,构建一个程序化(平面)API 可能只需要很少的工作。我不会编写一百万个函数,而是只编写我需要的函数,然后在 VC++ DLL 中实现这些简单的函数:
以上只是为了让您了解一下。我对内部 API 一无所知,但上面我向您展示的是您不需要 100% 符合 API 来编写包装器。您可能(如果您了解 C/C++)编写一个函数包装器来执行您需要的操作,然后导出它,将其链接到 DLL,然后将 QuickFix.dll 导入到 Python 中,只需很少的时间(专家需要花费 2-4 小时)如果您足够了解 Visual C++,能够编写一些简单的 C 风格(非 OOP)函数来实例化 C++ 类并调用 C++ 方法,那么时间)就可以工作。
可以通过包含 QuickFIx 的 C++Builder 包 (BPL) 将 C++ API 公开给 Delphi,但是 (a) 需要进行一些源修改,并且 (b) QuickFix 中的 C++ 代码或其依赖项可能会如果没有进行重大修改,则不能在 C++Builder 中构建。
This is probably more of a hack than anything else, but you could use the Python QuickFIX bindings in Delphi, via python4delphi. That's a lot of layers though (Delphi to Python to C++).
Python is an easy language to use, and learn, and it's easy to invoke and create python objects (or native C wrappers that pretend to be python objects) and invoke them directly from the Python4Delphi API.
Barring that, it might be very little work for you to build a procedural (flat) API as ABouchez said. Instead of writing a million functions I would write only the ones I needed, and then implement these simple functions inside a VC++ DLL:
The above are just to give you the flavor. I know nothing about the internal API, but what I'm showing you above is that you don't need to conform 100% to the API to write a wrapper. You could probably (if you know C/C++) write a functional wrapper that does what you need, and export it, link it into a DLL, and then import QuickFix.dll into Python with very little (2-4 hours of an expert's time) work, if you know Visual C++ well enough to write a few simple C-style (non OOP) functions that instantiate C++ classes, and invoke C++ methods.
It might be possible to expose the C++ APIs to Delphi via a C++Builder package (BPL) containing QuickFIx, but (a) some source modifications would be required, and (b) the C++ code in QuickFix, or its dependencies, might not build in C++Builder without significant modifications.