Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest Profit and Loss Changes With Tick Size

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

    Backtest Profit and Loss Changes With Tick Size

    I'm still endeavouring to perform multi instrument backtests, and I'm using a recently repaired installation of 7.0.1000.10.

    I've discovered some weirdness, which can be reproduced as follows:

    1. Test the SampleMACrossOver strategy on daily bars of 6E for 2012 with a default quantity of 1. The strategy analyzer tells me the Total Net Profit is -$10,975.00.

    2. Change the 6E Tick Size from 0.0001 to 0.00001 and try test 1 again. The strategy analyzer still tells me the Total Net Profit is -$10,975.00.

    3. Try test 1 again over daily bars of $EURUSD with a default quantity of 100,000. The strategy analyzer tells me the Total Net Profit is -$5113.00.

    4. Now change the $EURUSD Tick Size from 0.0001 to 0.00001 and try test 3 again. This time the strategy analyzer tells me the Total Net Profit is -$511.30.

    This is not what I expected. What is the explanation for this behaviour? Why is profit proportional to tick size for currencies, but not for the equivalent futures?

    Jim

    #2
    Hello Jim,

    Thank you for your post.

    I will test this item on my end and follow up with you when I have additional details.

    Comment


      #3
      Hello Jim,

      Thank you for your patience.

      I am unable to recreate this item on my end using the steps you provided.

      Please reset your instrument by going to the NinjaTrader Control Center > Tools > Options > Data > Reset Instruments > then restart NinjaTrader.

      Once complete please test with the same instructions you provided and please let me know if you still get the same results on the 6E after changing the tick size.

      Comment


        #4
        Hi Patrick,

        I followed your instructions. Even more intriguingly, 6E now tells me -$1287.50 for both tick sizes, whereas EURUSD gives the same answers as before. Actually I haven't any idea what the "correct" answer should be for either instrument. It's the difference in behaviour between futures and FX that concerns me at the moment. Can you reproduce the factor of 10 change on GBPUSD, with no change on 6E?

        Jim

        Comment


          #5
          Hello Jim,

          Thank you for your response.

          I get different results for both the EURUSD and 6E after adjusting their tick sizes, this would be expected.

          If you continue to receive incorrect results please repair your database with the instructions below:
          • Disconnect NinjaTrader from any open connections via File > Disconnect
          • From the NinjaTrader Control Center window select the menu Tools > Options
          • Select the "Data" tab
          • Press the "Repair DB" button
          • Press the "OK" button
          • Then Restart NinjaTrader

          Please let me know if you have any questions.

          Comment


            #6
            Hi Patrick,

            Originally posted by NinjaTrader_PatrickH View Post
            I get different results for both the EURUSD and 6E after adjusting their tick sizes, this would be expected.
            Are your results for both EURUSD and 6E different by a factor of 10? I'd certainly expect the two to behave in similar fashion. Without knowing a vast amount about how NinjaTrader works under the hood, I'd also expect something called "tick size" to have no effect on the calculated profit when it's accompanied by something else called "point value" instead of "tick value". Why do you expect changing "tick size" to produce a proportional change in the profit/loss of a trade? I'd expect PnL = Points * PointValue, with TickSize being irrelevant.

            Jim

            Comment


              #7
              Hello Jim,

              Thank you for your response.

              Each Point for an instrument is made up of a set number of Ticks/Pips, each Tick/Pip up or down will have an effect on your Profit and Loss.

              Take the 6E for example. By default the Tick Size is 0.0001 and the Point Size is 125,000.00.
              This means there are 10,000 ticks in a whole point, and each tick is worth $12.50.

              Changing the Tick Size will effect the results of your backtest, especially when it comes to currencies.

              Please let me know if you have any questions.
              Last edited by NinjaTrader_PatrickH; 02-06-2013, 07:15 AM.

              Comment


                #8
                Hi Patrick,

                Originally posted by NinjaTrader_PatrickH View Post
                Changing the Tick Size will effect the results of your backtest, especially when it comes to currencies.
                Empirical evidence suggests that this is indeed the case for currencies, but I'm still not sure why. I'm trying to discover what use the strategy analyzer makes of the various numbers in the instrument definition. According to the documentation:

                "Point Value - A double value representing the currency value of 1 point of movement"

                It seems to do what I expect for ES and 6E. However for currencies I'd expect it to be 1, which it isn't. This suggests the strategy analyzer handles currencies in a different way to futures, as does the experiment reported in my first post in this thread.

                To summarise, the manual suggests all the strategy analyzer needs to do to convert a profit in points to a profit in dollars is to multiply by the Point Value. This is evidently not what happens when the instrument in question is a currency. Why not, and what calculations does the strategy analyzer perform in such a case?

                Jim

                Comment


                  #9
                  Hello Jim,

                  Thank you for your response.

                  Can you provide an example of when the Currency is not correctly displayed for the Performance of a FOREX instrument?

                  From what I am seeing the Currency reports correctly for the amount of Pips in movement for the FOREX instruments.

                  In addition, what data provider do you connect to for FOREX data?

                  I look forward to your response.

                  Comment


                    #10
                    Hi Patrick,

                    Originally posted by NinjaTrader_PatrickH View Post
                    Can you provide an example of when the Currency is not correctly displayed for the Performance of a FOREX instrument?
                    Try changing the Tick Size of $EURUSD from 0.0001 to 0.00001, whilst leaving everything else unchanged.

                    In addition, what data provider do you connect to for FOREX data?
                    I guess I'm not explaining myself very well. The historical data and the data provider are not relevant to my questions, but to answer your question I'm currently using the free EOD data from Kinetick and/or EOD data manually imported from Bloomberg.

                    I'm trying to understand why and how the NinjaTrader strategy analyzer treats different classes of instruments differently, and differently to (my understanding of) the manual. One reason is because I'm from the UK, where we have exotic things like CFDs and spread bets, which NinjaTrader doesn't seem to cater for natively. Another reason is that on some of my long term backtests, and using your standard FX instrument definitions, the trade size ends up exceeding 2^32!

                    By way of example, pretending that a CFD was a tradeable "index" might work OK, except that NT forces the Point Value to be 1.00. This is acceptable in some instances, but not all. Is there any way I can mess with this "under the hood"?

                    Jim

                    Comment


                      #11
                      Hello Jim,

                      Thank you for your response.

                      I have changed the Tick Size alone on the EURUSD and found appropriate results to the Tick Size. Please provide a specific example from your end where the report is incorrect to the Tick Size.

                      There is no method to change how the Tick Size effects the performance results.

                      Comment


                        #12
                        Hi Patrick,

                        Originally posted by NinjaTrader_PatrickH View Post
                        I have changed the Tick Size alone on the EURUSD and found appropriate results to the Tick Size. Please provide a specific example from your end where the report is incorrect to the Tick Size
                        I provided a specific example in the first post in this thread. Perhaps you could provide me with a specific example, and explain to me why you feel your results are "correct to the Tick Size".

                        I can't help but think we're still at cross purposes here, so let me rephrase my query yet again. I want to work out the currency amount at risk for a particular trade (in the strategy analyzer, not in real life). Size * PointValue * (EntryPrice - StopPrice) gives the correct answer for 6E (whatever TickSize I enter in the instrument definition), but not for EURUSD. Does that help at all?

                        Jim

                        Comment


                          #13
                          Hello Jim,

                          Thank you for your patience.

                          It's expected that tick size is going to change performance results when changing the tick size of a Forex instrument, because there is another sub pip that can be tested on, or excluded from the calculations (0.0001 vs 0.00001).

                          With futures, the tick size you download the data for is the data you will test on regardless of changing the tick size. You would need to download the data again after changing the tick size.

                          For your equation can you provide an example of the variables in the equation that did not equal the correct value for the EURUSD?

                          Comment


                            #14
                            Hi Patrick,

                            I'm not talking about fractions of a pip difference. There's a factor of 10 difference! By way of further example:

                            I run a simple strategy with a fixed stop loss of 100 "pips" = 0.01 points.

                            On 6E with a size of 1 my formula works out to 1 * 125,000 * 0.01 = $1250
                            With the default tick size of 0.0001 the strategy analyzer tells me I lose 0.01 points/$1250 per trade.
                            If I change the tick size to 0.00001 the strategy analyzer still tells me I lose 0.01 points/$1250 per trade.

                            On EURUSD with a size of 100,000 my formula works out to 100,000 * 100,000 * 0.01 = $100,000,000
                            With the default tick size of 0.0001 the strategy analyzer tells me I lose 1000 points/$1000 per trade.
                            If I change the tick size to 0.00001 the strategy analyzer now tells me I lose 1000 points/$100 per trade.

                            Is this behaviour documented anywhere?

                            Jim

                            Comment


                              #15
                              Hello Jim,

                              Thank you for your response.

                              While this is not documented it is expected.

                              When changing the tick size of the future make sure you go through and reload the data you will be backtesting on. This is an important step as the futures data will still reflect the tick size as it was downloaded.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,610 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              19 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              16 views
                              0 likes
                              Last Post Javierw.ok  
                              Working...
                              X