views:

21

answers:

1

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#.

+1  A: 

Several extensibility points allow you to embed custom logic in your StreamInsight query:

  • User-defined aggregates and operators (http://msdn.microsoft.com/en-us/library/ee842720.aspx) allow you to perform arbitrary computations over the contents of a window.
  • User-defined functions (http://msdn.microsoft.com/en-us/library/ee378928.aspx) support custom logic over "primitive" types (strings, numbers, etc.).

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

Colin Meek