My problem for the moment relates to identifying the entry order associated with exit order fills in OnExecution().
It would be great if the read-only IOrder attribute FromEntrySignal had a Set() method so that I could set it and later refer to it in OnExecution().
Currently I am tying the exits and entries together by using the Token property of the exit order, and maintaining a Dictionary of exit tokens associated with my entry orders. Unfortunately I can't actually create unique order names for my exit orders because they need to match what ATM strategies use (TARGET1, STOP2, etc.). The Token is therefore the only unique identifier available in an exit order.
This works. However, the documentation warns that Token is not constant and can change when transitioning to live data. This is worrisome. It's fine for my own use, but not if I want to distribute this BAtm package to others.
If I had a Set() method for an exit order's FromEntrySignal field, that would provide me with a combination of attributes guaranteed to be unique, because all my entry signal IDs are unique. Then combining FromEntrySignal with the exit order name, I'd have a unique "token" for my token dictionary, and this token it wouldn't change when switching over to live orders.
I know a set method for FromEntrySignal must already exist internally, since the managed approach sets it. All you guys need to do is expose it for the rest of us, and it would help simplify bookkeeping in the unmanaged approach.
Consider exposing this method a feature request. Alternately, consider adding a read-write custom string to the IOrder class for programmers to use. Thanks.
Alex
Comment