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

Backtest Account - Set Values?

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

    Backtest Account - Set Values?

    I want to simulate specific order handling with trade sizes etc based account data, cash value etc. To do this we can get the AccountItems but the problem is these are tied to the Backtest account when performing a backtest.

    Is there any way to set the initial backtest account balance as it is not available in the list of accounts or anywhere in the options. Thanks.

    #2
    Also it seems that the CashValue does not update on the backtest account nor does the P&L. How can we access this info in a backtest to perform compounding over time based on actual account balance etc?

    Comment


      #3
      One more thing...

      If we have Instrument.MasterInstrument.PointValue, how do we get the tick value or ticks per point to calculate this? Didn't see anything in intellisense.

      Comment


        #4
        Hello fxRichard,

        Thank you for your post.

        When backtesting there is no means to set the values of the account. You would instead implement internal calculations in your strategy to calculate and track your own custom values for the desired account values.

        For the Tick value use the following:
        Code:
        double myTickValue = Instrument.MasterInstrument.PointValue * TickSize;
        For the number of ticks per Point please use the following:
        Code:
        double myNumTick = 1 / TickSize;
        Please let me know if you have any questions.

        Comment


          #5
          Thanks Patrick,

          On a real/live account I assume we would have access to this information? Can we put in a feature request to be able to set the backtest account value and have this value update throughout the life of a backtest?

          This is pretty simple stuff to add I would think and would allow those that do more advanced account management and order placement to use real calculations. The biggest thing is not being able to get the actual P&L or floating account balance as trades are won and lost.

          To do this for backtesting only we have to implement extra logic that I assume is not necessary on a live account running on real time data.

          Comment


            #6
            Patrick,

            Is there any way to determine the rolling P&L or floating CashValue of the account? Or do I need to monitor every trade in a backtest, calculate the win/loss and keep a dummy variable for this information.

            Ie. a trade just closed with 5 ticks profit on CL, and thus we have to manually keep track of the fact that this is a $50 profit per contract and manually subtract commissions etc?

            Comment


              #7
              Hello fxRichard,

              Thank you for your response.

              Cash Value would need to be a variable you create and track for the strategy during the backtests. As far as profit you can use the TradePerformance: http://ninjatrader.com/support/helpG.../cumprofit.htm

              I will forward your request to development.

              Comment


                #8
                Hello fxRichard,

                Thank you for your patience.

                The request for the account values to be available in the backtests for the backtest account has been assigned the internal tracking id of SFT-620.

                Please let me know if you have any questions.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by martin70, 03-24-2023, 04:58 AM
                15 responses
                114 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by The_Sec, Today, 02:29 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by jeronymite, 04-12-2024, 04:26 PM
                2 responses
                31 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by Mindset, 05-06-2023, 09:03 PM
                10 responses
                265 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by michi08, 10-05-2018, 09:31 AM
                5 responses
                743 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X