NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 12-13-2007, 05:27 PM   #1
arbifox
Member
 
Join Date: Jul 2007
Posts: 92
Thanks: 0
Thanked 0 times in 0 posts
Default Standard Return Code for Functions

For the following example:

function NTBuyMarket(orderId, quantity) {
return NTCommand("Place", "", "Buy", quantity, "Market", 0, 0, "", "", orderId, "", "");
}

Am I to assume that 0 is successfully placed, and -1 is not placed? Is that the general return code behind all of the functions which use NTCommand?

I am using this link for the order status:

http://www.ninjatrader-support.com/H...html?AppendixA

Is there another link which explains what these functions are supposed to return to signal success or failure?

Something similar to:

// Indicates if the connection to NinjaTrader is established. 0 = connected, -1 not connected.
function NTConnected() {
return (dll.call("Connected") == 0)
}

would be nice to have documented for examples of each function.

Regards,

Thomas
arbifox is offline  
Reply With Quote
Old 12-13-2007, 08:21 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

0 means that there were no errors generated by calling the function, and in general means that the order likely was placed.
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Market analyzer and chart return different values nicko9 Market Analyzer 5 08-04-2010 05:26 AM
Positions[0].Quantity return negative value when short? Folls Strategy Development 2 10-23-2007 01:13 PM
Code->test/debug->change code->retest ... cycle process bbarroux Strategy Development 3 10-02-2007 12:44 PM
standard ATM settings T4M ATM Strategies (Discretionary Trading) 1 04-09-2007 03:11 AM
Return values for NTOrderStatus() ccooper Automated Trading 2 11-11-2006 11:47 AM


All times are GMT -6. The time now is 10:11 PM.