PDA

View Full Version : ATI OrderStatus DLL Function Usage


whitmark
09-14-2007, 12:18 PM
Is there nuance to using the OrderStatus DLL function? I see in the help that it is defined as:

string OrderStatus(string orderId)

so in my Delphi code I declare:

FUNCTION OrderStatus ( OrderID: string ) : string; stdcall; external 'NtDirect.dll';

and call it via:

OrderStatus( Nj_LastOrderID );

where Nj_LastOrderID is a string that contains the OrderID that was submitted when the order was PLACED. The OrderFilled and AvgFillPrice function calls work fine and are coded in a similar manner but OrderStatus always returns null values. I've also noticed that NewOrderId() function is not returning any values. Are there any known issues with these functions or special usage instructions?

Thanks,

Whitmark

NinjaTrader_Ray
09-14-2007, 12:33 PM
They work as expected. I just ran our sample code as provided in the documentation against eSignal and it works as expected.

whitmark
09-14-2007, 12:49 PM
Thanks Ray . . . too bad you still don't have your NeoTicker account. :)

Should I expect a different response if the OrderID is not found? Can I differentiate between the function not working properly and OrderID not found?

Thanks

Whitmark

NinjaTrader_Dierk
09-14-2007, 01:50 PM
It will return empty string in case of an invalid order ID.

whitmark
09-16-2007, 09:49 AM
Looks like my issues had to do with proper declaration of the DLL functions in Delphi. It's been a while since I had worked with coding against the ATI and had forgotten that certain ATI functions require pchar vs string referencing when using a strongly typed programming language like Delphi. For example, the following code per the help facility will compile fine, but will return null values at runtime:

FUNCTION OrderStatus ( OrderID: string ) : string; stdcall; external 'NtDirect.dll';

however, the proper coding in Delphi is:

FUNCTION OrderStatus ( OrderID: pchar ) : pchar; stdcall; external 'NtDirect.dll';

I would suggest that since the use of the ATI with the NeoTicker platform is promoted and since most development is done using Delphi that this requirement be clarified in a footnote in the help facility for the Orders function and those functions that either require an OrderID pchar parameter or return an OrderID pchar value.

NinjaTrader_Ray
09-16-2007, 10:19 AM
Thanks for this suggestion.