Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

command - remove orders

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

    command - remove orders

    Hello,

    I couldn´t find which is the correct command to remove or delete limit-orders for the instrument from within a script. With "Position.Close()" the limitorders persist in orderstab (and on exchange I assume) and with ..Gui...FlattenEverything() it would work but all other trades and orders of other instruments would be flattened as well. This is not the intention.

    Thank you
    Tony

    #2
    Hello,

    For this you would need to call CancelOrder and provide the IOrder for the orders you are seeing.

    There is a good example of this in the help guide: http://www.ninjatrader.com/support/h...ub=cancelorder

    The order would need to be stored as an IOrder, then later when you need to cancel it just provide the stored IOrder to CancelOrder.

    I look forward to being of further assistance .
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      works fine, thank you. But I have another question pls: when searching for the syntax of Enterlong/shortLimit there is to find on support sites
      EnterLongLimit(int quantity, double limitPrice, string signalName)


      but in the sample it is
      EnterLongLimit(0, true, 1, Low[0], "Long Entry");


      What is "0" and "true" please?


      Thank you
      Tony

      Comment


        #4
        Hello,

        The best reference for anything script related will be the helpguide page for that specific item, for this if we look at this page; http://www.ninjatrader.com/support/h...rlonglimit.htm

        You can see all the ways this can be used listed near the top:

        EnterLongLimit(double limitPrice)
        EnterLongLimit(double limitPrice, string signalName)
        EnterLongLimit(int quantity, double limitPrice)
        EnterLongLimit(int quantity, double limitPrice, string signalName)
        EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)

        This says exactly how to use it, if you look at the example on the page it shows the second usage in the example or

        EnterLongLimit(double limitPrice, string signalName)


        For your question, this would most likely be the 5th usage or:

        EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hello,

          really sorry, I don´t know how this happened that I didnt see - maybe because you put the 5th sytntax out of order there in the list.

          I thought I have now all working fine in my script but there occurs an issue when testing in the meantime: I can do the entries correctly with fxcm and it works correctly with 6E and 6B and CL. But with ES it doesn´t work How is this possible? Once my variable "hlPrice" is triggered the script doesnt send a limit for ES BUT it does for the other instruments

          entryOrderkSa=EnterShortLimit(0,true,1,hlPrice+3*T ickSize, "kSa")

          Thank you
          Tony

          Comment


            #6
            Hello,

            day of issues it seems. When I click on "edit" the window is empty, there´s nothing to edit where I wanted to substitute "out of order" with "below the order of the list" because of wrong translation.

            Comment


              #7
              Hello,

              Are you referring to Edit on this page on the forum?

              For the order submission, if the condition is happening but the order is not it may be getting ignored or possibly one of the order handling rules is taking effect.

              Have you tried running this using TradeOrders = true ? http://www.ninjatrader.com/support/h...ub=traceorders

              This would list any ignores or other order handling rules in the Tools -> Output window if this is the case.

              Have you also looked in the log to see if the price the order is using is valid for the ES?

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by drnoggin, Today, 12:19 PM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by synthhokie, Today, 12:00 PM
              1 response
              16 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by moneyexe, Today, 11:22 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by stevec1824, Today, 11:00 AM
              2 responses
              8 views
              0 likes
              Last Post stevec1824  
              Started by sofortune, Today, 10:05 AM
              2 responses
              14 views
              0 likes
              Last Post sofortune  
              Working...
              X