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

CancelOrder() for Stop orders

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

    CancelOrder() for Stop orders

    Hi Ninjas,

    I've always used market orders which are always linked to Stop/loss and Profit/target orders. Every time that I wanted to reverse a position the system took care of cancelling orders, reversing and submitted again the new protective orders. Now I have a situation where I can use ONLY limit orders, this changes everything. So I have a basic question:

    How can I use CancelOrder() method to cancel any old Stop/loss and Profit/target orders ?

    Could you show me a little example of its correct use. I've tried to read in the guide how to do it, but for a non advanced user might be a little confusing.

    Thanks

    #2
    This will depend on if you're using SetProfitTarget or IOrders. It is possible with IOrders but not the Set methods.

    The advanced approach laid out here will be required: http://www.ninjatrader.com/support/h...r_handling.htm

    Depending on the method of your reversal it may also require the unmanaged approach but I would need to know more before I can answer.

    If this is too advanced please consider writing into support or contacting one of our 3rd party consultants here: http://www.ninjatrader.com/Ecosystem/NonBroker.php#81

    Let me know how I can further assist.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Hi Lance, thanks for your comment.

      I set the protective orders ( StopLoss and ProfitTarget ) like this:

      SetProfitTarget("", CalculationMode.Ticks, St);
      SetStopLoss("", CalculationMode.Ticks, St, false);

      So, since these kind of orders are not possible to cancel, where can I see a little example and hot to set and cancel these kind of protective orders?

      Thanks

      Comment


        #4
        It is not possible to cancel these orders (you can adjust them by calling the set method with new values) but they will be linked to a specific entry. When that entry is flattened the set stop or target will be canceled.
        LanceNinjaTrader Customer Service

        Comment


          #5
          Yes, the simple way to flatten it is with the proper Exit position order; but since I look for a complete reverse, using limit orders is where I'm stuck.

          Comment


            #6
            Am I right to understand you're trying to reverse your open position by placing a limit entry order in the opposite direction? If so this would not be possible even with the advanced order handling and would require the unmanaged approach (assuming you trade with stops and targets) due to the order handling explained in the bottom section here: http://www.ninjatrader.com/support/h...d_approach.htm
            LanceNinjaTrader Customer Service

            Comment


              #7
              Yep. Thanks anyway Lance. I'm trying to simplify the reversing process in small modules. If I needed further help I'll let u know

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by kulwinder73, Today, 10:31 AM
              0 responses
              5 views
              0 likes
              Last Post kulwinder73  
              Started by terofs, Yesterday, 04:18 PM
              1 response
              23 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by CommonWhale, Today, 09:55 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Gerik, Today, 09:40 AM
              2 responses
              7 views
              0 likes
              Last Post Gerik
              by Gerik
               
              Working...
              X