PDA

View Full Version : dll shortcoming


maxpi
06-28-2007, 10:07 PM
Hi, I just got NT going yesterday and it was not difficult to change an indicator in Tradestation to one that is placing orders with my IB simulation account. I appreciate the clarity of documentation and good working order of the dll.

One suggestion so far: I would love it if the command NTMarketposition would return the number of contracts/shares as well as the marketposition. The dll seems incomplete without that capability. I am deploying a strategy that trades just one contract of the YM all day, always in the market. If I am off by one contract then the whole thing is off pretty badly for the day if the one extra contract is not in the market direction.

I can write a unit of code to keep track of all the order id's and their positions to make sure I am not holding more than one contract in either direction but it is extra code and extra cpu cycles and I'm guessing that the IB API would give up the number of contracts if the dll asked for it.

NinjaTrader_Dierk
06-28-2007, 11:30 PM
- value > 0: Long
- value < 0: Short
- value = 0: Flat

maxpi
06-29-2007, 11:52 AM
Funny, according to the docs it should return a value from -1 to 1 but I am getting the number of contracts... which is what I was suggesting!!

NinjaTrader_Ray
06-29-2007, 11:55 AM
Where in the DOC? For sure this needs to be corrected. This is what we have:

int MarketPosition(string instrument, string account)

Gets the market position for an instrument/account combination. Returns 0 for flat, negative value for short positive value for long. This function will only return values for positions initiated via the ATI.

maxpi
07-01-2007, 01:23 PM
I must have been mixed up. I guess I was tired and read <0 as -1. Sorry