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

OCO and cancelling order questions

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

    OCO and cancelling order questions

    If I enter a long position with a particular signal name, and then I call both ExitLongStop and ExitLongLimit using the same signal name, if either the limit or the stop is hit, will the other always get automatically cancelled, ie. will this be an OCO order? In running the simulations that seems to be the case but I just want to verify that it the case always.

    Also, in running the simulation, I find that my code might possibly cancel a current EnterLongStop and then switch to EnterShortStop. This seems to work okay, but when I cancel an order and then create a new order, should I use a different signal name, or is using the same signal name of an order I cancelled okay?

    Thanks in advance,

    Ken

    #2
    Originally posted by kjackson View Post
    Will this be an OCO order?
    kjackson, yes it will be.
    Originally posted by kjackson View Post
    Should I use a different signal name, or is using the same signal name of an order I cancelled okay?
    It is possible to use the same signal name but it is recommended to use different names for long and short entries.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks for your answers, Austin.

      Just to expand on my second question, is it recommended that every time an order is cancelled and a new order it placed, that a new signal name should be generated for the new order? For example, if I place an EnterLongStop order, and then cancel it, and then place a new EnterLongStop order, should I use a new signal name again?

      Generating new signal names isn't a problem (I'm assuming that just adding a count to the signal name is fine, ie. Trade1, Trade2, Trade, etc). I'm just trying to understand what the rules are with signal names on orders that have been placed but not filled yet.

      Thanks in advance,

      Ken

      Comment


        #4
        Ken,

        You do not have to generate a new name, but if you want to differentiate the two, you should do so.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          great, thanks Josh!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by eladlevi, Today, 08:41 AM
          2 responses
          4 views
          0 likes
          Last Post eladlevi  
          Started by FAQtrader, 04-25-2024, 12:00 PM
          9 responses
          149 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by ETFVoyageur, Yesterday, 02:10 AM
          5 responses
          51 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by ETFVoyageur, 05-07-2024, 07:05 PM
          20 responses
          163 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Ludwik, Today, 03:52 AM
          4 responses
          28 views
          0 likes
          Last Post Ludwik
          by Ludwik
           
          Working...
          X