PDA

View Full Version : How to determine if a bracket order completed gracefully.


mkundi
06-26-2005, 02:27 PM
How to determine if a bracket order completed gracefully i.e. .... it completed its lifecycle ..... either the profit target had a complete fill ...... or the stop loss had a complete fill. I am using the strategis (no passthru).

The PUF ought say, (correct me if I am wrong),

"FLAT",0,....

So the condition FLAT, and position_size=0 ....... should indicate a graceful end ?

Are there other conditions if "FLAT",0,.... would still be true, yet its actually not a graceful end ?

NinjaTrader_Ray
06-26-2005, 11:34 PM
Should say FLAT and the average entry price greater than zero.

mkundi
06-27-2005, 06:29 AM
So the second field, position_size cannot be relied on ...... ?

Its the avg_price .... thats the deciding factor if a bracket order completed its term, right ?

NinjaTrader_Ray
06-27-2005, 07:26 AM
When DIRECTION parameter returns FLAT, you can check the AVERAGE ENTRY PRICE to determine if a position was closed or, if the initial entry order is in a pending (waiting to be filled) state. If the AVERAGE ENTRY PRICE returns a value of zero, then the position is in a pending state.

mkundi
06-27-2005, 08:09 AM
Hi, I did some AT testing today, and noticed,

When the position is CLOSED.... the PUF is deleted ---- which is fine by me.

I also look for the condition of presence/absence of the PUF i.e. ES 09-05SIM-101update.txt

However, the order status file = positionES 09-05SIM-101.txt .......... still exists after position close.

So, please elaborate, what u mean, if the position is closed, there is no PUF to read.

I am fine with that, but wanted to clarify what u meant.