Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter order and Stop Loss

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

    Enter order and Stop Loss

    Hello,

    I developed a strategy with Ninja Script with Stop Loss. The stop loss is in percents.
    My problem is that if I have a small percent for the stop loss (like 0.5%) I have in the same bar Close position, Enter Long and Stop loss order.
    When I have a Stop loss Order I want to wait till the next bar to open a position (long or short)
    I attached the the chart to see the problem on 07/02/2010
    Any suggestion?
    Attached Files

    #2
    ThanosK

    I am happy to assist.

    Prices can move through quite a range in a bar before it is closed. It is possible your strategy is entering orders, then the price moves and stops your order out before that bar even closes. Since you mention you experience this issue when you have small stop-losses, I suspect this is your issue.

    As far as your second question, you may consider using BarsSinceExit(). It accepts entry signal name as input, not the exit signal name. If you add a barssinceexit > 0 condition, it will apply to all exits, not just stop losses. For more information on BarsSinceExit(), please see the link below.



    Please let me know if I can assist you further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Dear NinjaTrader_AdamP,

      I tried the BarsSinceExit() and the BarsSinceEntry() function but i had the same result.
      Gould you tell how can i avoid the price range in the same bar?

      Thanks

      Comment


        #4
        Hi ThanosK,

        I'm sorry but I did not follow what you are looking for. Adams suggestion involved using BarsSinceExit() so that you can avoid submitting entry orders on the same bar as an exit.

        Can you please clarify what is "avoid the price range in the same bar?"
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Dear Ryan,

          I used the function BarsSinceExit(), but when the percent is below 1 I had entry order and Stop loss on the same bar. I don't know if i can avoid the entry order in the first place if I have stop loss in the same bar?

          Thank's in advance
          Last edited by ThanosK; 10-06-2011, 02:59 PM.

          Comment


            #6
            Please see this post for the NinjaScript techniques that are needed to submit a stop order to a smaller series, and gain intrabar granularity.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Thank you for the reply.

              As I read I can use the ExitLongStop for back testing environment.
              What about a real time strategy?

              Comment


                #8
                Absolutly, there would be no difference in how you use it in realtime.
                BrettNinjaTrader Product Management

                Comment


                  #9
                  It is better to use the SetStopLoss function or the ExitLongStop for the real time?

                  Comment


                    #10
                    Hello,

                    This would depend on the rest of your strategy and how other orders are handling.

                    You should be familiar with Internal Order Handling Rules that Reduce Unwanted Positions to ensure you do not run into any issues:

                    MatthewNinjaTrader Product Management

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    648 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    369 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    108 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    572 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    573 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X