Show / Hide Table of Contents

Class Account_Default

The Account class maintains the status of the trading account.

Inheritance
object
Account_Default
Implements
IAccount
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TuringTrader.SimulatorV2
Assembly: TuringTrader.Simulator.dll
Syntax
public class Account_Default : IAccount

Constructors

| Edit this page View Source

Account_Default(Algorithm)

Create new account.

Declaration
public Account_Default(Algorithm algorithm)
Parameters
Type Name Description
Algorithm algorithm

parent algorithm, to get access to assets and pricing

Properties

| Edit this page View Source

AnnualizedReturn

Calculate annualized return over the full simulation range.

Declaration
public double AnnualizedReturn { get; }
Property Value
Type Description
double
| Edit this page View Source

Cash

Return of cash available, as fraction of NAV.

Declaration
public double Cash { get; }
Property Value
Type Description
double
| Edit this page View Source

Friction

Friction to model commissions, fees, and slippage expressed as a fraction of the traded value. A value of 0.01 is equivalent to 1% of friction. Setting Friction to a negative value will reset it to its default setting.

Declaration
public double Friction { get; set; }
Property Value
Type Description
double
| Edit this page View Source

MaxDrawdown

Return maximum drawdown over the full simulation range.

Declaration
public double MaxDrawdown { get; }
Property Value
Type Description
double
| Edit this page View Source

MinPosition

Minimum position size, as fraction of total account value. A value of 0.01 is equivalent to a minimum position of 1% of the account's liquidation value.

Declaration
public double MinPosition { get; set; }
Property Value
Type Description
double
| Edit this page View Source

NetAssetValue

Return net asset value in currency, starting with $1,000 at the beginning of the simulation. Note that currency has no relevance throughout the v2 engine. We use this value to make the NAV more tangible during analysis and debugging.

Declaration
public double NetAssetValue { get; }
Property Value
Type Description
double
| Edit this page View Source

Positions

Return dictionary with currently open positions. The key is the nickname used to load the asset. The value is a floating point number, representing the allocation to the asset as a fraction of the accounts NAV.

Declaration
public Dictionary<string, double> Positions { get; }
Property Value
Type Description
Dictionary<string, double>
| Edit this page View Source

TradeLog

Retrieve trade log. Note that this log only contains trades executed and not orders that were not executed.

Declaration
public List<IAccount.OrderReceipt> TradeLog { get; }
Property Value
Type Description
List<IAccount.OrderReceipt>

Methods

| Edit this page View Source

Deposit(double)

Deposit cash to account.

Declaration
public void Deposit(double cashPcnt)
Parameters
Type Name Description
double cashPcnt

cash deposited as fraction of NAV

| Edit this page View Source

ProcessBar()

Process bar. This method will loop through the queued orders, execute them as required, and return a bar representing the strategy's NAV.

Declaration
public OHLCV ProcessBar()
Returns
Type Description
OHLCV
| Edit this page View Source

SubmitOrder(string, double, OrderType, double)

Submit and queue order.

Declaration
public void SubmitOrder(string Name, double weight, OrderType orderType, double orderPrice = 0)
Parameters
Type Name Description
string Name

asset name

double weight

asset target allocation

OrderType orderType

order type

double orderPrice

trigger price for stop and limit orders

Implements

IAccount
  • Edit this page
  • View Source
In this article
Back to top Copyright © 2011-2023, Bertram Enterprises LLC dba TuringTrader.com