Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A couple of programming questions...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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

    #2
    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.
    RayNinjaTrader Customer Service

    Comment


      #3
      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,

      Comment


        #4
        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.

        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.

        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.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X