Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Intrabar Stoploss

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

    Intrabar Stoploss

    I'm working on a scalping strategy and have a standard SetStopLoss set within Initialize.

    I'm having trouble with the stop apparently triggering within the current bar when the stop price never touches the stop after the entry.

    In the attached price goes from the open, hits the entry price, the continues up and should have exited at the target, instead the screen reports a stop out. What am I missing?
    Attached Files

    #2
    Hello Kentoes,
    Are you experiencing this when backtesting or through testing with a live data feed?
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Historical trades with live data as printed on the chart, Haven't checked it going forward in real time or via strategy analyzer.

      Comment


        #4
        Hello,
        The historical trades use the same values and fill as you could expect from using the strategy analyzer. Historical trades will use OHLC values to check for fills. This can cause some discrepancies as you have noticed such as stops filling.

        What appears to have happened is the stop filled due to the bar being within the value of your stop. With the way that the fills work the engine does not know if the bar dropped after your entry or before your entry due to this fact it designates a fill. If you are trading live this would only occur if the price dropped after your initial entry.

        You could remedy this by adding in logic for the historical trades to fill based off of a 1 tick granularity. This is a common worked around for backtesting and we have a reference sample of how to do this at the following link: http://ninjatrader.com/support/forum...ead.php?t=6652
        I would also recommend to review the following link on understand discrepencies with historical fills and live fills with strategies: http://ninjatrader.com/support/helpG...ime_vs_bac.htm

        If you have any other questions please let me know.
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          Thanks. The sample has

          Code:
          EnterLong(1, 1, "Long: 1min");
          I'm using the following and getting "No overload for method 'EnterLongStop' takes '4' arguments"


          Code:
           EnterLongStop(1,DefaultQuantity, High[0] + Offset * TickSize, "BuyLong");
          Not sure what all 4 arguments are supposed to be.

          Comment


            #6
            Hello,
            The overload to utilize the Bars In Progress Index requires five arguments: EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)

            For the EnterLongStop() method you are missing the argument for the live until cancelled bool.
            For more information on this please see the following link: http://ninjatrader.com/support/helpG...erlongstop.htm

            I would also recommend reviewing the following link on Advanced Order Handling concepts: http://ninjatrader.com/support/helpG...r_handling.htm
            Cody B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Gerik, Today, 09:40 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RookieTrader, Today, 09:37 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by alifarahani, Today, 09:40 AM
            0 responses
            5 views
            0 likes
            Last Post alifarahani  
            Started by KennyK, 05-29-2017, 02:02 AM
            3 responses
            1,285 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by AttiM, 02-14-2024, 05:20 PM
            11 responses
            186 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X