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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X