Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How if a bar's range covers both stop loss price and target profit price?

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

    How if a bar's range covers both stop loss price and target profit price?

    If I use both SetStopLoss and SetProfitTarget in my NinjaScript strategy and run backtesting, what is the rule for NT's backtesting engine to determine at which price the trade happens when a bar's range covers both prices?

    #2
    bourbonnais,

    It depends on which order it hits them, so its dependent on higher-scale information. In other words, whatever the price hits first is executed first.

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

    Comment


      #3
      Originally posted by NinjaTrader_AdamP View Post
      bourbonnais,

      It depends on which order it hits them, so its dependent on higher-scale information. In other words, whatever the price hits first is executed first.

      Please let me know if I may assist further.

      So, if I use 1-minute historical data, when new bar covers both prices (target price and stop loss price), without knowing which price is hit first based on 1-minute data, NT will try to load tick data and determine which one is hit first? Is this what you mean?

      For example, I run backtest using 1-minute data, and I have a target price $101 and stop loss price $99 and a new 1-minute bar has high $102 and low $98.

      Comment


        #4
        bourbonnais,

        Apologies, I misunderstood your question.

        Essentially the fill price of an order has an algorithm that can be set, and you are only allowed to run strategies on the close of bars in backtesting. So any input price will be the close. If the close is at or below the stop it will trigger the stop price. If the close is at or above the profit target, it will trigger the profit target.

        Here is more information : http://www.ninjatrader.com/support/h...ime_vs_bac.htm
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by elirion, Today, 01:36 AM
        0 responses
        2 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        2 views
        0 likes
        Last Post gentlebenthebear  
        Started by samish18, Yesterday, 08:31 AM
        2 responses
        9 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by Mestor, 03-10-2023, 01:50 AM
        16 responses
        389 views
        0 likes
        Last Post z.franck  
        Started by rtwave, 04-12-2024, 09:30 AM
        4 responses
        31 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Working...
        X