Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Back test report reports incorrect trade profit and loss figures.

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

    Back test report reports incorrect trade profit and loss figures.

    HI,

    I have a strategy that I ran in a Sim account real time and it made $1500. When the strategy is reloaded and a historical report is run it reports exactly $0.00 for profit and loss on the same 6 trades.

    The trade figures are also suggestive of a bug. As for the same 6 trades two are for exactly +$90.00 two -exactly $90.00 and 3 $for $0.00.

    Here is a side by side of the 6 trades, top is real time Sim and bottom historical.

    I've seen the back test programs reporting significantly higher profits than the actual but this is a first where it's reporting far less profit then occurs in Sim.

    The bar type is also Unirenko which I understand is supported but no a native bar type of NT.

    glen

    Attached Files

    #2
    Hello demarcog,

    Thank you for your post.

    Looks like you originally posted this in the NinjaTrader 7 forum, so I've moved it to the correct forum.

    That certainly does look suspicious - especially the Cumulative Net Profit being way off.

    Were these results from a backtest in the Strategy Analyzer or running the strategy on Market Replay data in the Playback connection?

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi Kate,

      Sorry about that never used NT7.

      To answer your question neither Playback nor "Strategy Analyzer" .

      The first report with the 6 profitable trades were printed off the Strategies Tab, right click strategy name - strategy performance - real time. All of those trades made it to a sim account and I produced the report well after the trades were made.

      The other report is the strategy loaded into a chart with the exact same settings used when the strategy was loaded in the Strategy tab. Loaded and enabled strategy, right click chart Strategy Performance Historical.

      I look forward to working this problem together.

      One question. Sometimes it can take and last night at 2am did take hours to load up a bunch of charts, change all the input parameters, select the proper Data Series parameters etc etc. Then to fix a problem with Playback Mode, an old problem where orders are rejected for too low a cash etc. the mitigation is to rename the database NinjaTrader.sdf, or sometimes restart ninja etc.

      Is there anyway at all to save what gets loaded into a strategies tab?

      Last night again playback mode fails with the rejections that others have had and I'm told to bring down NT and rename the database.

      There must me a way to save the strategies tab, via workspace, or template or xml file maybe to copy in and out. I can understand why many things cause the strategies to be disabled, and even that can be troublesome but it's understandable and can live with it. But loosing hours of work, and having to redo it to eventually loose it again. Someone somewhere in development, perhaps, the info in the strategies tab is stored somewhere, probably in xml format that surely I can perserve across restarts?

      thank you

      glen


      Comment


        #4
        Hello demarcog,

        Thank you for your reply.

        Strategy instances are saved in the database when they are applied via the Strategies tab, so renaming the database would cause these saved instances to be removed. There would not be a way to save/load the list of strategies applied if the database is renamed/reset. You would need to manually reapply the strategies.

        If you are hitting a cash balance issue when running the strategy in simulation, either on live or in playback, the solution would be to reset the Sim account to refresh/increase the starting account balance, not to jump directly to a database rename/reset. This would allow you to maintain the list of strategies in the Strategies tab.

        As for the odd order PnL for the historical trades, you mentioned you renamed the database last night. Does the issue persist if you also clear your cache before testing again?

        To delete the cache, follow the steps below.
        • Shut down NinjaTrader.
        • Open the Documents > NinjaTrader 8 > db folder.
        • Delete the sub-folder named 'cache'.
        • Restart NinjaTrader and test.
        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Kate,

          Thank you very much for the response.

          Understood and thank you very much for the help.

          I was advised to rename the data base without Trying the very useful interim steps you suggested the perhaps tI miscommunicated or there was a misunderstanding with the person who advised me. At the time I was just happy to get Playback working. But after manually reloading those strategies with all the parameters to be set for each strategy, especially troublesome in the wee hours when it's being setup to run overnight and they are gone.

          So thank you very much for the great advice I really appreciate the fantastic support you all provide. It really is unique in this industry as I've been dealing with IT support for many decades.

          Glen

          Comment


            #6
            Kate,

            The same problem is happening and I reset the SIM1010 account, and deleted the cash and still getting the same. It took me hours to setup those strategies and don't want to spend more time because of this bug, and there has to be a way of saving these strategies.

            Please Help.

            glen

            Comment


              #7
              Hello glen,

              This is Jim, responding on behalf of Kate who is out of the office at this time.

              Resetting a Sim account, or renaming the database file will remove any strategies that are already configured.

              If you are looking for a quick way to set up your strategies, a strategy template can be used.

              Working with Strategy templates - https://ninjatrader.com/support/help..._templates.htm

              We look forward to assisting.

              JimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jpapa, Today, 07:22 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by kevinenergy, 02-17-2023, 12:42 PM
              116 responses
              2,758 views
              1 like
              Last Post kevinenergy  
              Started by franatas, 12-04-2023, 03:43 AM
              7 responses
              106 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Jltarrau, Today, 05:57 AM
              3 responses
              9 views
              0 likes
              Last Post Jltarrau  
              Started by f.saeidi, Today, 05:56 AM
              2 responses
              8 views
              0 likes
              Last Post NinjaTrader_Erick  
              Working...
              X