NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 01-04-2008, 08:12 AM   #1
Goonior
Junior Member
 
Join Date: Jan 2008
Posts: 8
Thanks: 0
Thanked 0 times in 0 posts
Default A couple of programming questions...

Didn't find answers on my first pass through the documentation, so I figured the forum would be quicker:

1) How do I cancel a pending order using NinjaScript? There are methods for entering a new position and exiting an existing position, but I couldn't find anything which allows you to cancel an unfilled order.

2) How do you link orders together as One-Cancels-Other, etc? For example:
I have a breakout strategy that goes long above X and short above Y. I want both orders active at the same time, but want the long order to be canceled if I go short (and vice versa).

3) How do I adjust the charts so that there is a fixed interval between the vertical time grid lines. For example, I would like the chart to start at 6:30am, and display 6:30, 7:00, 8:00, 9:00, etc, rather than 7:46, 8:06, 8:26, etc, etc.

Thanks for your help.
Matt
Goonior is offline  
Reply With Quote
Old 01-04-2008, 08:33 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

1) Orders automatically cancel at the close of a bar if they are not re-submitted again. One exception is if you are using NT 6.5 Beta, then there is an option to submit "LiveUntilCancelled" orders in which case you can use the Cancel() method.

2) Although this is supported in the current production release of 6.0, in 6.5 it will not be. You can only place one entry order in any direction.

3) Custom X axis formatting is unfortunately not supported.
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-04-2008, 09:11 AM   #3
Goonior
Junior Member
 
Join Date: Jan 2008
Posts: 8
Thanks: 0
Thanked 0 times in 0 posts
Default Regarding Question #1...

Not sure I understand completely...Does this mean that unfilled orders cancel at the close of a bar?
If so, I assume this implies that all orders are held locally on Ninjatrader and not submitted to the brokerage servers?
For example, if I am running a Ninjascript on a 2 minute chart and I submit an a limit order that is a large amount away from the current price, it will be deleted at the end of the bar and must be resubmitted each following bar until filled?

Thanks much,
Goonior is offline  
Reply With Quote
Old 01-04-2008, 09:18 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
Default

Quote:
Originally Posted by Goonior View Post
Not sure I understand completely...Does this mean that unfilled orders cancel at the close of a bar?
That is correct unless they are re-submitted.

Quote:
If so, I assume this implies that all orders are held locally on Ninjatrader and not submitted to the brokerage servers?
No this does not imply that. All orders are sent to your broker/exchange.

Quote:
For example, if I am running a Ninjascript on a 2 minute chart and I submit an a limit order that is a large amount away from the current price, it will be deleted at the end of the bar and must be resubmitted each following bar until filled?
No. If not re-submitted, then it will be cancelled. If re-submitted, NT will leave the order working at the broker/exchange.
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
Programming connections Gumphrie Connecting 6 12-11-2009 03:09 AM
NinjaTrader programming services Raditz Indicator Development 4 06-25-2009 05:37 PM
Programming error message Betty Installation and Licensing 1 11-05-2007 09:09 AM
Advanced Programming sbtrader General Programming 3 10-26-2007 10:11 AM
Need Help Programming Custom Indicator from TS to NT stevestrading Indicator Development 4 06-20-2007 04:31 PM


All times are GMT -6. The time now is 12:56 AM.