Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problems getting account info

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

    problems getting account info

    Hello- I'm having an issue with the GetAccountValue(AccountItem.CashValue) statement.

    I keep getting zero. This is with a live strategy. I am connected to IB with the strategy enabled with the account selected. I'm putting this statement in the OnStartUp() method because I only need this info on start up of the strategy.

    any ideas?

    #2
    Hello ciro1963,

    Thanks for your inquiry.

    GetAccountValue() will return 0 for historical bars and only will return an actual value for realtime bar iterations. This also means that calling from OnStartUp() would return 0.

    Reference on GetAccountValue() can be found here - https://ninjatrader.com/support/help...countvalue.htm

    Please let us know if you have any additional questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Yes I tried putting the statement in the onbarupdate but still comes out as zero. Could it be getting confused with the sim account? Also Does the statement return a string or do I need to convert it to a string in order to print it to the output window?

      Comment


        #4
        Hello ciro1963,

        Are you making sure that the value is getting printed for realtime bars and not historical bars?

        This can be tested with if(Historical) return;

        I've attached a demonstration showing the print for the Sim101 account and a paper trading account. You can set up a similar test on your end as well.

        Demo: https://www.screencast.com/t/H7Ys7M0w4W

        Please let me know if there is anything else I can do to assist.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rhyminkevin, Today, 04:58 PM
        1 response
        30 views
        0 likes
        Last Post Anfedport  
        Started by iceman2018, Today, 05:07 PM
        0 responses
        4 views
        0 likes
        Last Post iceman2018  
        Started by lightsun47, Today, 03:51 PM
        0 responses
        7 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        14 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        49 views
        0 likes
        Last Post futtrader  
        Working...
        X