View Full Version : Strange positions appearing in log
molecool
06-25-2009, 08:59 AM
I have very strange things happen on my end, which is a bit too involved to explain. HOWEVER, I think the culprit for the errors I'm getting are these strange positions I see when tailing my log - here are two examples:
6/25/2009 6:58:33 AM Position Instrument='ES ##-##' Account='Sim101' Avg price=924.407407407407 Quantity=11 Market position=Short Operation=Update Currency=Unknown
6/25/2009 7:09:51 AM Position Instrument='ES ##-##' Account='Sim101' Avg price=924.013636363636 Quantity=10 Market position=Short Operation=Update Currency=Unknown
Now, obviously the ES is not at 924 today - it's currently hovering above 900. Can you guys give me an idea of what's going on here?
Thanks,
Michael
P.S.: Very disappointed about the NT7 delay - very....
NinjaTrader_Josh
06-25-2009, 09:07 AM
Please explain the situation if we are going to be able to evaluate this. Thank you.
molecool
06-25-2009, 06:03 PM
I've hooked into the following methods to append an email message buffer:
onExecution() method: to append stop details for an entry alert emails I send myself.
onPositionUpdate() method: to append any trade execution details - I filter by stop/target/entry - just like in the examples you guys provide.
It all works fine for 3 of my strategies which are fairly complex (i.e. multi timeframes and I take 15 minute entries but 1 minute based exits).
It 'sometimes' fails with one of my strategies that only works on a 1 minute timeframe - it's a scalper. For some reason intermittently the buffer is empty - thus I get an empty email. I have logging all over the place and it seems that the onExecution and onPositionUpdate methods are not even being called when that happens, which is strange. The order is being executed as it should but the buffer is empty, thus I get an email alert which is empty as well.
Again, if this happened all the time I would have figured it out by now, but it seems to be completely intermittent.
Told ya, it's a strange problem.
Please explain the situation if we are going to be able to evaluate this. Thank you.
NinjaTrader_Josh
06-26-2009, 07:08 AM
What I suggest is to turn on TraceOrders = true and see if it provides you with any information. Please also check in your code if you are resetting the IOrder to null to early. If you are printing the IOrder and it is null then it will be blank.
molecool
06-26-2009, 11:05 AM
What I suggest is to turn on TraceOrders = true and see if it provides you with any information. Please also check in your code if you are resetting the IOrder to null to early. If you are printing the IOrder and it is null then it will be blank.
1) Where do I set traceorders to true - in my init method?
2) I'm actually compounding my own description of the trades taken, so there should be at least 'something' IYKWIM. The fact that it prints nothing at all means the the entire method is getting skipped which is highly unusual. Hope this makes sense.
NinjaTrader_Josh
06-26-2009, 11:09 AM
1. Yes.
2. TraceOrders will tell you if the order was placed or not and whether it was rejected/ignored/etc which your own prints likely cannot catch.