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

Buy and Sell Stops

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

    Buy and Sell Stops

    Is it possible to place buy and sell stops on a bar instead of straight buy or sell? For example if close > open of bar X then place a buy stop above its high and a sell stop below its low. And keep this condition open for X bars down the road. When one is hit the other becomes the stop. And then can add a profit target or trail.
    Thank you.

    #2
    Hello Trader17,

    Thanks for your post.

    Yes, there are entry methods that use stopmarket or stoplimit orders, these can be done in the managed approach and unmanaged approach however depending on the mode used they are done differently between the two approaches, please review the helpguide here: http://ninjatrader.com/support/helpG...er_methods.htm

    In the managed approach you would not be able to place a bracket type order on the same bar. Please see the managed approach Internal Order Handling Rules that Reduce Unwanted Positions in this section: http://ninjatrader.com/support/helpG...d_approach.htm What you could do, in the managed approach, is create your code to monitor price movement and place the appropriate order, ie if price goes above the high of the previous bar enter long (either with a straight market order or a stopmarket or stoplimit at some level above that. Opposite if the price goes below the low of the previous bar.

    In the unmanaged approach there are no protective rules and you may place orders as you wish however your code would be responsible for all error handling and order management aspects.

    You can read about the managed approach here: http://ninjatrader.com/support/helpG...d_approach.htm

    You can read about the unmanaged approach here: http://ninjatrader.com/support/helpG...d_approach.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      What about One Cancels Other type of Order? Can a strategy do that. Also can you specify how long you want the orders pending before cancelling? Is this a little advanced for the Wizard to do?
      Thanks.

      Comment


        #4
        Hello Trader17,

        Thanks for your post.

        Yes, the profit and target can be OCO tied if in the managed approach you use the SetProfitTarget and SetStopLoss methods.

        In the managed approach, by default, entry orders not filled at the end of the bar are automatically canceled. These are the type orders submitted by the strategy builder. To submit more advanced orders that are not automatically canceled you would need to code directly in Ninjascript using with the managed or unmanaged approach.

        Please see the links in my previous post for details of the unmanaged and managed approach.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank you. I am sorry. I was not clear. I meant OCO as in a buy stop and sell stop order placed by the strategy. When one entry order is filled the other is cancelled out and managed by profit/loss specified in strategy. Can such entries be set up in the Wizard and be open on more than one bar or it is custom coding at that point?
          Thanks Paul.

          Comment


            #6
            Hello Trader17,

            Thanks for your reply.

            It cannot be done in the strategy builder, it cannot be done n the managed approach, it can be done in the unmanaged approach.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thanks a lot. So I do need custom coding. I thought the Wizard might be able to do it.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              22 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              43 views
              0 likes
              Last Post jeronymite  
              Working...
              X