Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 nandhumca, Yesterday, 03:41 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by The_Sec, Yesterday, 03:37 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by vecnopus, Today, 06:15 AM
        0 responses
        1 view
        0 likes
        Last Post vecnopus  
        Started by Aviram Y, Today, 05:29 AM
        0 responses
        5 views
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        27 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X