Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to exit all directional positions when reversal signal is triggered?

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

    How to exit all directional positions when reversal signal is triggered?

    Hello, I'm very new to ninja, do not have a clue when it comes to programming, so I am trying to put a strategy together using the strategy wizard screen.

    So far I have condition set A which triggers a bullish trade, and condition set B which triggers a bearish trade. Each direction could trigger up to 3 trades.

    What I need help with is figuring out how to exit all trades once a reversal signal is triggered before price hits the stop losses of the remaining open trades.

    For example, if I have 2 bullish trades remaining open, and they have not hit their targets or their stop losses yet, but a reversal signal is acknowledged, how can I set it on strategy wizard to exit all remaining open bull trades and replace it with a new bear trade?

    thanks!

    #2
    Hello gubbar924,

    Thank you for the question I will be happy to help out.

    When you use the Strategy wizard, you are by default using the Managed Strategy approach.

    What this means is that NinjaTrader will try to do what is best when you call your entries or exits in the wizard.

    In your case what you are trying to do is close out any positions that you may have open when the reversal condition happens.

    For your example, in either direction if you call an Exit for the type of order without a signal name or quantity this will exit all positions in that direction.

    Here is an example of how to use this

    In your wizard you have a condition which puts you into a long position by using the EnterLong()

    Next you want to exit this position for all open long positions when your reversal signal happens, to do this you would want to use ExitLong() and specify no entry signal or quantity. This would exit all open long positions.

    If you take a look at the help guide here: http://www.ninjatrader.com/support/h...l?exitlong.htm

    At the bottom in the notes you can see the process it takes depending on what parameters you give it.

    Also this document explains the managed approach to the strategy in more depth.


    You may note in the help guide there is an unmanaged approach, this is a much more advanced order processing that is generally used in advanced strategies that are created outside the wizard, just wanted to mention this so there is no confusion.


    Please let me know if I may be of additional assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse, looks like that just may do the trick. One last question ... when I set the stop loss and target via the strategy wizard, are those market orders? Is there a way to get the profit target to make sure and do a limit order to fill at my target or better?

      Comment


        #4
        Hello gubbar924,

        You are correct, they would be submitted as market.

        The only way around this would be to submit your own profit target and stop loss orders not using the built in methods in the wizard.

        You would essentially submit what order type you would like as your profit target and stop limit and then control that with the logic in the strategy instead of using the built in profit target and stop loss. This would allow you to place limit or stop limit orders for example.

        Please let me know if I may be of additional assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse, I just want to make sure I have this right ...

          so the take profit and stop loss put in the wizard are all market orders, by this logic I'm assuming that take profits put into regular ATM strategies are also market orders. So the only way to put in a stop limit profit target is through the DOM via the middle mouse button then?

          Comment


            #6
            Hello gubbar924,

            When you are using the wizard you can specify a price that is other than the market price for these.

            I am sorry for the confusion what I mean to say is that Profit targets, stop loss and trail stop orders are submitted immediately to the market. meaning that they are sent to the broker right away but at the price you specify.

            The Stop loss orders are submitted as stop market orders
            The SetProfitTarget would generate a limit order.

            The Profit target there would not be a way to do limit or better, once the limit is met this would be filled.

            For your question regarding the DOM:

            Yes you can enter your limit orders using the Middle mouse click in the DOM. Also you can set the stop loss and profit target using an ATM strategy, for more information on ATM strategies I would recommend reviewing this document:


            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              got it, thanks Jesse!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by judysamnt7, 03-13-2023, 09:11 AM
              4 responses
              59 views
              0 likes
              Last Post DynamicTest  
              Started by ScottWalsh, Today, 06:52 PM
              4 responses
              36 views
              0 likes
              Last Post ScottWalsh  
              Started by olisav57, Today, 07:39 PM
              0 responses
              7 views
              0 likes
              Last Post olisav57  
              Started by trilliantrader, Today, 03:01 PM
              2 responses
              21 views
              0 likes
              Last Post helpwanted  
              Started by cre8able, Today, 07:24 PM
              0 responses
              10 views
              0 likes
              Last Post cre8able  
              Working...
              X