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

Account Cash Value/GetAccountValue Seems High

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

    Account Cash Value/GetAccountValue Seems High

    I'm using the simulator to backtest a strategy. I've noticed that the cash value is much higher than what it should be.

    For example, one month I started with $2000 as my cash value and realized $1653.59. However, GetAccountValue returned (and the cash value on the Accounts tab showed) $6323.26. The Realized value on the Accounts tab is correct.

    This is baffling because I'm not doing anything to manipulate the cash value. I'm just using EnterLong and EnterShort as normal.

    I did switch to ExitLongLimit/ExitShortLimit from SetProfitTarget around when I noticed this happening. Could that be the problem? Is there another setting that I should check? Thanks for your feedback.

    #2
    Hello micprice,

    Thank you for your inquiry.

    I am a bit unclear of what you are doing. If you are running a backtest on a strategy, this will not affect your account outside of the backtest. The Accounts tab on the NinjaTrader Control Center shows your current account information. GetAccountValue will return that information about the account the strategy is running on, hence why both values match.

    Once your strategy starts making live trades, then the account will be affected.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      I'm actually using a simulation account, with the initial value set to $2000. The value of the simulation account has always kept in step with what was being realized. Lately, it hasn't and it's not clear why.

      I'm suspecting it's safest to just calculate the account value myself based upon the starting value, and what the strategy realizes through trading. This may also help avoid any syncing issues when I go live. Well, have a great holiday!

      Comment


        #4
        Hello micprice,

        The same would apply if you are using a simulation account. A backtest does not take any account into account when doing trades; all it is doing is testing the performance of a particular strategy over a period of time you specify.

        The account will only be affected when a strategy is active on an account and is performing trades in real time.

        Have a great holiday!
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Perr0Grande, Yesterday, 08:16 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by f.saeidi, Yesterday, 08:12 AM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by algospoke, Yesterday, 06:40 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by quantismo, Yesterday, 05:13 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X