NinjaScript > Language Reference > Strategy >

GetAccountValue()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Returns information about the account the strategy is running on.
 

Method Return Value

A double value that represents the specified account item. A value of 0 will be returned on historical bars.

 

Syntax
GetAccountValue(AccountItem accountItem)

 

Parameters

accountItem

Possible values:
AccountItem.BuyingPower

AccountItem.CashValue

AccountItem.RealizedProfitLoss

 

 
Examples

protected override void OnBarUpdate()
{

    // Checks to see if the account has more than $25000
    if (GetAccountValue(AccountItem.CashValue) > 25000)
        // Do something;
}