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 helpwanted, Today, 03:06 AM
      1 response
      7 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      7 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X