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

Enter if touch strategy?

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

    Enter if touch strategy?

    I read several online documents teaching day-trading Forex saying the one should place a long order if the price goes above the resistance and short if it goes below the support.

    Now I remember reading something saying that one could place an order watching both way, one is canceled if another one is triggered. For example, the short order is canceled if the long order is placed! And vice versa! (I can't remember the name!)

    Is it possible to realize it in NT strategy!?

    Thank you very VERY much for teaching me! God bless you!!!

    #2
    Hello YoutingChu,

    Yes this type of logic could be possible in NinjaScript. Likely the most simple way would be to use Order objects to track the orders, and then CancelOrder() to eliminate the orders that are no longer needed.

    We have a sample that demonstrates the syntax needed to collect the order and also cancel it here: https://ninjatrader.com/support/help...thod_to_ca.htm

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

    Comment


      #3
      Dear Jesse,

      Thank you very much for your help! I have been studying the sample code this couple days, I find out I have NO confidence monitoring all the orders correctly! I'm afraid I might buy extra orders or, even worse, forget to exit any order!

      I figure out what I'm looking for is OCO orders! Is it possible to place an OCO order DIRECTLY and let the internal algorithm do the canceling jobs for me!?

      Thank you very VERY much for your help! God bless you!!!

      Comment


        #4
        Hello YoutingChu,

        Thank you for your response.

        If you wish to place the orders manually you can use one of the Order Entry windows and enable OCO before placing both orders, then disabled OCO to ensure that only those two orders are tied together.

        You can find information on the Order Entry windows in NinjaTrader at the following link: https://ninjatrader.com/support/help...rder_entry.htm
        You can find information on OCO in NinjaTrader at the following link: https://ninjatrader.com/support/help...OtherocoOrders

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Today, 06:40 PM
        0 responses
        10 views
        0 likes
        Last Post algospoke  
        Started by maybeimnotrader, Today, 05:46 PM
        0 responses
        7 views
        0 likes
        Last Post maybeimnotrader  
        Started by quantismo, Today, 05:13 PM
        0 responses
        7 views
        0 likes
        Last Post quantismo  
        Started by AttiM, 02-14-2024, 05:20 PM
        8 responses
        168 views
        0 likes
        Last Post jeronymite  
        Started by cre8able, Today, 04:22 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X