Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting and live (paper) trades are different

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

    #46
    mart331,

    The best example we have for this is this reference sample:
    Backtesting NinjaScript Strategies with an intrabar granularity


    There will always be differences between a backtest and running a strategy live.
    Ryan M.NinjaTrader Customer Service

    Comment


      #47
      Unfortunately, I work this way. But I can prove it to you something is wrong.

      As you can see in the image,

      I add 2 bartypes;
      I enter long/short on barsarray == 1 (based on values of barsarray ==2)
      So, the tradelogic does NOT have anything to do with the main chart.

      In optimize, I ONLY optimize on dataserie, in this case from 1 to 5 minutes,
      and you see the differences.... (period = 6 weeks)
      from 700 to 10.000 profit

      In my view all must be the same.
      None of these results equal by far the replay results.
      Attached Files

      Comment


        #48
        Originally posted by NinjaTrader_Jason View Post
        Hello mart331,

        When performing a backtest the indicator values are only known at the close of a bar. While running a strategy in real-time, indicator values are calculated intra bar (Calculate on bar close = False).

        Could this be the cause of the discrepancy?
        If I'm using tick data and the price is based on the Bid, is there anyway I can have the indicator values calculated interbar?

        Comment


          #49
          by the way, the results show profit in $, that should be euro's.

          Comment


            #50
            @ RedEye, unfortunately there are no intra bar calculations when performing backtests in the Strategy Analyzer. Only the OHLC values are used.

            @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.

            Comment


              #51
              Originally posted by NinjaTrader_Jason View Post
              @ RedEye, unfortunately there are no intra bar calculations when performing backtests in the Strategy Analyzer. Only the OHLC values are used.

              @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.
              Please also reply to my earlier post. Thanks

              Comment


                #52
                Originally posted by NinjaTrader_Jason View Post

                @ mart331, unfortunately the Strategy Analyzer can only display currency values in US dollar. For example, the FDAX is set to Euro in the Instrument Manager. However when performing a backtest, the profit or loss in Euro will be reflected in US dollar. Please note that this is an absolute conversion - 1 Euro = 1 US dollar.
                There's not even a conversion is there? Backtest doesn't know anything about currencies and just displays numbers. In fact, most of Ninja doesn't do currencies properly does it? If I have a live trade in FGBL and a live trade in YM a 20 euro profit will be displayed as 20 dollars and would be added to the dollar trade to give a completely incorrect total in dollars.

                In fact, proper multi currency support rather than a slightly implemented approach has been a suggestion for well over two years. See this thread

                Comment


                  #53
                  @ mart331, could you perhaps start a new thread as per these inquiries. Unfortunately I am not a programmer and very knowledgable with NinjaScript - I cannot comment on this. It would more clear for the thread itself as well, since multiple users post in here.

                  @ dave1992, yes unfortunately there is no conversion. I will forward your feedback to my superiors.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  592 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  343 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  556 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  554 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X