Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AccountItem.SodCashValue Returning 0

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

    AccountItem.SodCashValue Returning 0

    Hi NinjaTrader Support & Community,

    I'm developing a custom AddOn for risk management (NinjaTrader 8.1.3.1) and need to programmatically retrieve the account balance at the start of the trading day for display purposes in a custom window (specifically to show absolute balance levels for a trailing drawdown threshold).

    Based on the documentation for AccountItem, I've tried using AccountItem.SodCashValue

    Code:
    // Inside a method that has access to the Account object
    Account account = ... // Get the relevant account object
    double startOfDayBalance = account.Get(AccountItem.SodCashValue, Currency.UsDollar);
    // Log the value...​
    Code:
    Log:
    2025-04-14 11:25:00.724 [Info ] StatusWindow account selection changed to: Sim101
    2025-04-14 11:25:00.725 [Info ] startOfDayBalance: 0

    ​However, I'm consistently finding that this call returns a value of 0.

    I have tested this thoroughly in the following environments:
    1. Playback Connection: Using downloaded Market Replay data (e.g., for NQ 06-25).
    2. Simulated Data Feed: Connected to the default "Sim101" account.
    3. Live Account Connection: Using my own live brokerage account connection.

    In all three scenarios, querying AccountItem.SodCashValue resulted in 0, even after the market had been open for some time (tested on Monday morning local time, which is Sunday evening US market open).

    My questions are:
    1. Is AccountItem.SodCashValue expected to return a non-zero, accurate starting balance value when using the Playback connection or the standard Simulated Data Feed?
    2. Does SodCashValue depend on specific data providers or broker connections (e.g., older forum posts mentioned it might primarily work with CQG)? If so, which connections currently support it reliably?
    3. Is there a specific timing aspect (e.g., does it only populate after the broker's official settlement time is passed and data is pushed)?
    4. Is there any other recommended API method within NinjaScript to reliably obtain the official, broker-reported start-of-day account balance (Cash Value or Net Liquidation) that works consistently across Live, Sim, and Playback connections?

    My goal is to display the actual balance level corresponding to risk thresholds, but this relies on getting an accurate starting balance. The alternative is calculating and storing it manually when my AddOn detects a session rollover, but I wanted to confirm if there's an official API value I should be using first.

    Thanks for any insights or guidance!
    Aviram Y
    NinjaTrader Ecosystem Vendor - Aviram Y

    #2
    Hello Aviram Y,

    From my understanding the StartOfDayCashValue (SodCashValue) only applies to CQG connection accounts (AMP).

    This is not available with the Sim101, Playback, or NinjaTrader Brokerage accounts.

    I am not aware of any API methods to retrieve this value.

    You could choose to use an addon to save the CashValue at the start of a new day to a static variable.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you ChelseaB
      Aviram Y
      NinjaTrader Ecosystem Vendor - Aviram Y

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      557 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X