Thursday, January 26, 2012 4:09 PM
How does it actually work?
For example; I have quote ticks (bid and ask), with a normal join I can join them both but last price ticks don't always occur so its not right to expect that every bid & ask join has a last price.
But what if I need the latest last price? I can simply write a outer join for edge last prices but with the tests that I make I now that its not possible because of the temporal overlapping (I guess)
Thursday, January 26, 2012 4:48 PM
You're on the right track ... it's likely that your issue is due to the events not overlapping in time. The trick is to get them to overlap. When trying to visualize this, I'll write it out on the board ... with the Alter/clip/shift or other temporal operations as they are applied. I've found that this helps tremendously.
Fortunately, it's easy to get the last known value and make sure that it overlaps with the current. If you want to make sure that you have the latest values for join goodness, you can use the ToSignal() macro works beautifully. This will always provide a "Last Known" value for a specific group.
If you want to get the previous value and compare to the current, check out FoldPairs in the StreamInsight samples for LinqPad. It's similar to ToSignal (AlterEventDuration / ClipEventDuration) but then uses ShiftEventTime to get an overlap of 1 tick between the previous and the current values.
DevBiker (aka J Sawyer)
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful.
- Marked As Answer by Stephanie LvModerator Thursday, February 02, 2012 10:11 AM