Strategies

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Add On > Account >

Strategies

Previous page Return to chapter overview Next page

Definition

A collection of StrategyBase objects generated for the specified account

 

Property Value

An Collection of StrategyBase objects

 

Syntax

<Account>.Strategies

 

Examples

ns


private Account myAccount;
 
protected override void OnStateChange()
{
  if (State == State.SetDefaults)
  {
      // Initialize myAccount
  }

}
 
private void OnAccountStatusUpdate(object sender, AccountStatusEventArgs e)
{
  foreach (StrategyBase strategy in myAccount.Strategies)
  {
      Print(String.Format("Account status updated. {0} strategy applied with position {1}", strategy.Name, strategy.Position));
  }
}