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 funk10101, Today, 09:43 PM
            0 responses
            6 views
            0 likes
            Last Post funk10101  
            Started by pkefal, 04-11-2024, 07:39 AM
            11 responses
            37 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Yesterday, 08:51 AM
            8 responses
            44 views
            0 likes
            Last Post bill2023  
            Started by yertle, Today, 08:38 AM
            6 responses
            26 views
            0 likes
            Last Post ryjoga
            by ryjoga
             
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            24 views
            0 likes
            Last Post algospoke  
            Working...
            X