Class Account_Default
The Account class maintains the status of the trading account.
Inheritance
Implements
Inherited Members
Namespace: TuringTrader.SimulatorV2
Assembly: TuringTrader.Simulator.dll
Syntax
public class Account_Default : IAccount
Constructors
| Improve this Doc View SourceAccount_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
| Improve this Doc View SourceAnnualizedReturn
Calculate annualized return over the full simulation range.
Declaration
public double AnnualizedReturn { get; }
Property Value
Type | Description |
---|---|
double |
Cash
Return of cash available, as fraction of NAV.
Declaration
public double Cash { get; }
Property Value
Type | Description |
---|---|
double |
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 |
MaxDrawdown
Return maximum drawdown over the full simulation range.
Declaration
public double MaxDrawdown { get; }
Property Value
Type | Description |
---|---|
double |
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 |
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 |
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 |
---|---|
System.Collections.Generic.Dictionary<TKey, TValue><string, double> |
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 |
---|---|
System.Collections.Generic.List<T><IAccount.OrderReceipt> |
Methods
| Improve this Doc View SourceDeposit(double)
Deposit cash to account.
Declaration
public void Deposit(double cashPcnt)
Parameters
Type | Name | Description |
---|---|---|
double | cashPcnt | cash deposited as fraction of NAV |
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 |
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 |