I have a strategy that creates up to 4 orders per signal in a direction (long or short), a trade set for long or short signals. Each order (trade) has its own unique identifier (i.e. BarNumber+n+L or BarNumber+N+S where "n" is 1, 2, 3 or 4).
A trade "closes" when it's stopped out, profit target hit, or a counter signal is generated.
Ok, so here's my question...
Is there a way to identify the individual trade when it "closes"? I've noticed that closed trades are either individually closed (i.e. stopped out or profit target achieved) -- and/or closed out together in one bundle, on one trade order (i.e. if 4 long trades then all 4 are closed out -- or sometimes 3 of 4, etc...).
I've looked into OnExecutionUpdate and OnOrderUpdate to see if I can identify the entry signals to the exit signals, but trades can be individually closed or closed in a group.
I have an external database that I've setup to log all entries and exits and I'm trying to tie the trade pairs together for reporting purposes.
Thanks,
Big Surf
Comment