• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 johnnybegoode, Today, 11:35 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by NickyD, Today, 09:07 AM
        3 responses
        14 views
        0 likes
        Last Post NickyD
        by NickyD
         
        Started by 7robert, Today, 06:46 AM
        3 responses
        62 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by ElMagoR, Today, 07:49 AM
        4 responses
        31 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by Nabil, 09-13-2019, 11:44 AM
        5 responses
        35 views
        0 likes
        Last Post Nabil
        by Nabil
         
        Working...
        X