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 fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,403 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        94 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        6 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X