Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetAccountValue once at StartUp?

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

  • NinjaTrader_Joydeep
    replied
    Hello
    You cannot use the GetAccountValue as it is a real time property only.

    Leave a comment:


  • Tdschulz
    replied
    It returns 0.

    Any suggestions how to get the account value at startup?

    Leave a comment:


  • NinjaTrader_Joydeep
    replied
    Hello Tdschulz,
    GetAccountValue is a realtime only property and it will return 0 in OnStartUp or on historical bars.

    Code:
    A value of 0 will be returned on historical bars.

    Leave a comment:


  • Tdschulz
    started a topic GetAccountValue once at StartUp?

    GetAccountValue once at StartUp?

    I'm trying to call the account value once once when I start the strategy but I see that OnStartUp does not return a Value. I was trying:
    Code:
     protected override void OnStartUp()
            {
             	
    			double morningaccountSize = GetAccountValue(AccountItem.CashValue);	
            }
    How can I get the account size upon starting the strategy?

Latest Posts

Collapse

Topics Statistics Last Post
Started by DayTradingDEMON, Yesterday, 02:10 PM
6 responses
39 views
0 likes
Last Post rockmanx00  
Started by Pointtoni, Yesterday, 11:41 PM
3 responses
35 views
0 likes
Last Post jenacie.com  
Started by Nate G, 03-17-2025, 02:53 PM
4 responses
72 views
1 like
Last Post timko
by timko
 
Started by several, 03-18-2025, 03:53 AM
11 responses
184 views
1 like
Last Post timko
by timko
 
Started by Amelie4262, Today, 10:45 AM
0 responses
14 views
0 likes
Last Post Amelie4262  
Working...
X