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

Cash Value

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

    Cash Value

    Hey everyone,

    Does anyone know of any bugs when it comes to bringing in the account cash value? I use it for a position sizing algo but it seems to "sometimes" not pull in the data. I.E. when I print the cash value it "sometimes" returns 0. Other times it works.

    This is the syntax I am using to bring in Cash Value.

    Code:
    GetAccountValue(AccountItem.CashValue)
    Code:
    Print(GetAccountValue(AccountItem.CashValue))
    Cheers

    SodyTexas

    #2
    Please check the Accounts tab and ensure there is a value reported for the account you wish to get this at that time.

    Also note that a value of 0 will be returned on historical bars. To ensure you are checking the account item on real-time data, you can check if you're on historical data:

    //only run on real time data
    if(!Historical)
    GetAccountValue(AccountItem.CashValue)
    MatthewNinjaTrader Product Management

    Comment


      #3
      Ohh shoot your right, I am broke.. Ha ha J/K, that would suck; the account value is showing. I will add the syntax you provided and give it a try. Thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by rdtdale, Today, 01:02 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by RookieTrader, Today, 09:37 AM
      4 responses
      19 views
      0 likes
      Last Post RookieTrader  
      Started by PaulMohn, Today, 12:36 PM
      0 responses
      9 views
      0 likes
      Last Post PaulMohn  
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      41 views
      0 likes
      Last Post love2code2trade  
      Working...
      X