Ok... kind of got all that working enough to find out the "MarketPosition" is not the parameter that I want. It does something strange. When I enter long... MarketPosition is "Long". that's good. But when I close that position, MarketPosition says "Short". And when I'm flat, there are no more MarketPosition updates using PositionUpdate.
So I'm back to looking at Executions and focusing on "Position" in the most recent Execution update. The Positiion parameter is numerical and represents a negative or positive number for short or long and zero if flat. But I need to select the most recent execution from the collection and still not sure how to do that.
I've been looking at LinQ methods but no idea which syntax to use.
I really appreciate your help Shodson, but just to let you know, I'm not a complete beginner. I've been learning C# since I first started working with NinjaTrader 3 years ago. I've learned a lot, but being in an unsupported area of NinjaScript makes this part more difficult. Ive done a few things with collections before but they are not second nature to me. I just need bread crumbs to keep my going the the right direction.
Last night I was looking at the trace file and found what I think will work. I was troubled because "ExecutionUpdateEventArgs" didn't have what I was looking for. But in the trace file I found there was another ExecutionUpdateEventArgs which is ExecutionUpdateEventArgs2. Refer to the attachment. It has the "Position" parameter that I want. Triggering on that even I will get the latest position information for the instrument I'm interested in.
I tried to add the code but during the compile I get an error. Does anyone know how to get "ExecutionUpdateEventArgs2" ?