Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Current Balance of account during backtest

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

    Current Balance of account during backtest

    Hi, i am using the account balance in a strategy. Every thing is fine on real time but for the backtest period, it seems that the account balance is "reset" on starting of each day. Is this true ? if yes, how can i retrieve the value of the account balance ? thank you for your help

    #2
    Hello rht5692,

    Thanks for your post.

    There is no account used when backtesting a strategy in the Strategy Analyzer so you will see a value of zero print out when calling Print(Account.Get(AccountItem.TotalCashBalance, Currency.UsDollar));.

    This is because there is no backtest account in the Strategy Analyzer to get this information from. The Strategy Analyzer simply runs the strategy on historical data to see how that strategy might have worked on that past data.

    You could consider using the Playback connection which does use an account (Playback101) when testing NinjaScript strategies.

    See the help guide pages linked below for more information.

    Playback: https://ninjatrader.com/support/help...8/playback.htm
    Account: https://ninjatrader.com/support/help...ount_class.htm
    Account.Get(): https://ninjatrader.com/support/helpGuides/nt8/get.htm
    AccountItem: https://ninjatrader.com/support/help...ccountitem.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    79 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X