StreamInsight 查询中的代码
我正在开发一个使用复杂事件处理的算法交易应用程序,并且正在研究 Microsoft StreamInsight 作为 CEP 处理器。但是我不确定我想做的一切是否都可以在 StreamInsight 中实现。
特别是,我需要能够动态创建策略,然后将其作为常设查询插入到服务器中。例如,A 创建了一个策略,当股票 X 的 30 天平均值上涨到特定值以上时,必须下达买入订单。然后,必须在 StreamInsight 查询中进行转换,并在运行时将其放置在服务器上。
我可以在 StreamInsight 查询中执行什么类型的代码?我不确定我想要执行的所有处理是否都可以在 StreamInsight 查询中进行,因为它们是 linq 查询。我可以使用其他数据源的数据吗?我可以在查询中使用开关、循环、变量声明等吗?或者它只是一个查询,就像编译查询一样?
这一切听起来可能有点模糊,如果需要的话我会尝试进一步澄清。基本上,我的问题是,我可以对 StreamInsight 查询进行编程有多复杂?我找到的示例仅显示了简单的过滤、分组等。
也欢迎有关其他 CEP 服务器的建议,尽管我真的更愿意留在我的专业领域,即 .NET/C#。
I'm developing an algorithmic trading application using complex event processing and I'm looking into Microsoft StreamInsight as CEP processor. However I'm not sure if everything I want to do is possible within StreamInsight.
Particularly, I would need to be able to dynamically create strategies that would then be inserted into the server as standing queries. For example, person A creates a strategy where a buy order has to be placed when the 30 day average of stock X rises above a certain value. This would then have to be translated in a StreamInsight query and be placed on the server at runtime.
What sort of code can I execute in a StreamInsight query? I'm not sure if all the processing that I want to do is possible in a StreamInsight query, since they are linq queries. Can I use data from other data sources? Can I use switches, loops, variable declarations etc. in a query? Or is it just one single query, like with compiled queries?
This all probably sounds a bit fuzzy, if need be I will try to clarify further. Basically, my question is, how complex can I program my StreamInsight queries? The samples that I have found only show simple filtering, grouping, etc.
Suggestions about other CEP servers are also welcome, although I would really prefer to stay in my area of expertise, which is .NET/C#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
多个扩展点允许您在 StreamInsight 查询中嵌入自定义逻辑:
StreamInsight 的适配器模型 (http://msdn.microsoft.com/en-us/library/ee378877.aspx) 允许您连接到任意数据源,无论它们是实时的还是历史的。
如果您对如何启用特定功能有疑问,请告诉我们!
-科林
Several extensibility points allow you to embed custom logic in your StreamInsight query:
StreamInsight's adapter model (http://msdn.microsoft.com/en-us/library/ee378877.aspx) allows you to connect to arbitrary data sources, whether they are real-time or historical.
If you have questions about how to enable specific functionality, please let us know!
-Colin
您可以在 StreamInsight 服务器运行时创建查询以执行新操作。一旦您熟悉了 StreamInsight API,操作起来并不困难,并且可以在 StreamInsight 服务器本地完成(如果您在进程内托管)或使用管理服务远程完成。正如 Colin 所说(上面),您可以将自定义代码添加到查询中以执行自定义评估。
You can create queries while the StreamInsight server is running to do new things. Once you are familiar with the StreamInsight API, it's not that difficult to do and can be done local to the StreamInsight server (if you are hosting in-process) or remotely using the Management Service. As Colin said (above), you can add custom code into your queries to perform custom evaluations.