Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reliability Of Exit Prices

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

    Reliability Of Exit Prices

    Hi,

    I appreciate the backtest is based on CalculateOnBarClose, however there are many occasions during my backtest when a bar has both an entry and an exit signal... which is great its in keeping with what I would imagine would happen.

    However, it occured to me, will the back test "look inside the bar" for want of a better phrase and see which was hit first, the stop or the profit target.

    Please see attached image and you will see this sold at the previous bar's high, profit target was hit and then the bar continued higher. Is the backtest accurate in seeing that the profit target was reached before the bar went up.

    The back test would be pretty useless if it didn't do that, but just wanted to check

    Thanks
    Attached Files

    #2
    Hello Tom,

    Thank you for your note.

    Yes, if you are using the Set() methods for the Profit Target and Stop Loss, then these get evaluated on the same bar as the entry. When both are running and the bar has the potential to fill either order, it will default to the Stop Loss. This will give you a worst case scenario.

    In your case, the stop loss was great enough to not be reached by the bar and thus the profit target was filled in the same bar.

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hey Cal

      Thanks for that. What if the profit target price was created on the bar before I entered. So the low of the bar was 50. I sold at 60 with a profit target of 50. Would the back test realise that 50 was hit before I entered the trade and would not have been touched after?

      Or does it just look at the bar and see there was a lower print (out of order) and give me the profit?

      It's just if you were to have a wider stop loss than profit target (outside the range of a typical bar) it might just give you profits on every trade unless it takes into account what the bar looked like before and after the entry?

      Thank you
      Last edited by Tomhgriff1; 10-27-2014, 01:34 AM.

      Comment


        #4
        Hello Tom,

        You have the right idea.

        The backtest will only know the Data values of the bar and not the intrabar data.

        So, yes if you did have a wide enough stoploss you would see more profits filled if they meet the criteria of the bar prices.

        If you are wanting to do some intrabar testing with the Backtest then you will want to take a look at the link below on Intrabar Granularity -
        http://www.ninjatrader.com/support/f...ead.php?t=6652
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Hi Cal,

          Thank you for this.

          Ive had a look at the link you provided and downloaded that file. But to be honest I have no idea what I am supposed to do with it? I don't know much about coding? Is it supposed to be copied into my NinjaScript? What exactly will it do?

          I was thinking, can't you just tell the backtest to look at a smaller bar for the exit? It might then have a slightly more accurate result. So enter on a 60min chart for example but look at the smallest timeframe possible to check to see whether stop loss or profit target would be hit first.

          Otherwise it seems to be impossible to work a system with a wider stop loss than target because if the bar isn't wide enough to hit your stop loss it will give you the profit 90% of the time.

          Comment


            #6
            Hello Tomhgriff1,

            Thank you for your response.

            My colleague followed up with you on this item via e-mail. Keep in mind that Set() methods will process on the primary bar series, you could use Exit() methods instead but you would have to create logic to place the Exit() methods. In the future, please help us by communicating via e-mail or the support forum so that we do not have multiple representatives assisting you on the same item.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by JonesJoker, 04-22-2024, 12:23 PM
            6 responses
            32 views
            0 likes
            Last Post JonesJoker  
            Started by GussJ, 03-04-2020, 03:11 PM
            12 responses
            3,239 views
            0 likes
            Last Post Leafcutter  
            Started by AveryFlynn, Today, 04:57 AM
            0 responses
            5 views
            0 likes
            Last Post AveryFlynn  
            Started by RubenCazorla, 08-30-2022, 06:36 AM
            3 responses
            79 views
            0 likes
            Last Post PaulMohn  
            Started by f.saeidi, Yesterday, 12:14 PM
            9 responses
            25 views
            0 likes
            Last Post f.saeidi  
            Working...
            X