Positions

<< Click to Display Table of Contents >>

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

Positions

Previous page Return to chapter overview Next page

Definition

A collection of Position objects generated for the specified account

 

Property Value

An Collection of Position objects

 

Syntax

Account.Positions

<Account>.Positions

 

Examples

ns


protected override void OnStateChange()
{
  if (State == State.DataLoaded)
  {
      lock (Account.Positions)
      {
          Print("Positions in State.DataLoaded:");
 
          foreach(Position position in Account.Positions)
          {
              Print(String.Format("Position: {0} at {1}", position.MarketPosition, position.AveragePrice));
          }
      }
  }
}