Class TradingOptions
- Namespace
- ATAS.DataFeedsCore
- Assembly
- ATAS.DataFeedsCore.dll
Trading and risk rules that the ATAS emulation (simulated trading) server applies to portfolios: commissions, leverage, allowed securities, position and order limits and drawdown limits. Assigned to a UserGroup or to an individual Portfolio; the portfolio's own options take precedence over its group's options. For every numeric limit, 0 means the limit is not applied. Money values are in the portfolio currency, volumes are in lots.
public class TradingOptions : IEntity
- Inheritance
-
objectTradingOptions
- Implements
- Extension Methods
Constructors
TradingOptions()
Initializes new options with an empty route list and no security restrictions.
public TradingOptions()
Properties
ApplyOvernightSwap
Gets or sets whether overnight swap is charged on open positions.
public bool ApplyOvernightSwap { get; set; }
Property Value
- bool
AvailableSecurities
Gets or sets the security codes allowed for trading (for futures, the root code without month and year). An empty list allows all securities.
public List<string> AvailableSecurities { get; set; }
Property Value
- List<string>
BlockBalance
Gets or sets the equity (balance plus open PnL) at or below which new orders are rejected and all positions are closed.
public decimal BlockBalance { get; set; }
Property Value
- decimal
Commission
Gets or sets the commission group used to charge commissions on trades; setting it also updates CommissionId.
public CommissionGroup? Commission { get; set; }
Property Value
CommissionId
Gets or sets the identifier of Commission; null when no commission group is assigned.
[Browsable(false)]
public long? CommissionId { get; set; }
Property Value
- long?
EntityType
Gets the type of the entity.
[Browsable(false)]
public EntityType EntityType { get; }
Property Value
Id
Gets or sets the database identifier of the options.
[Browsable(false)]
public long Id { get; set; }
Property Value
- long
IntradayLeverage
Gets or sets the leverage of the portfolio between SessionBeginTime and SessionEndTime. 2 by default.
public decimal IntradayLeverage { get; set; }
Property Value
- decimal
IsIsolatedMargin
Gets or sets whether positions use isolated margin: each position is closed when the market reaches its liquidation price, and BlockBalance is not checked.
public bool IsIsolatedMargin { get; set; }
Property Value
- bool
Leverage
Gets or sets the leverage of the portfolio outside the intraday session. 1 by default.
public decimal Leverage { get; set; }
Property Value
- decimal
MaxDrawdown
Gets or sets the maximum daily loss, a positive amount: when the open plus closed PnL falls to its negative value, new orders are rejected and all positions are closed.
public decimal MaxDrawdown { get; set; }
Property Value
- decimal
MaxOpenOrders
Gets or sets the maximum number of active orders; new orders beyond it are rejected.
public int MaxOpenOrders { get; set; }
Property Value
- int
MaxOrderSize
Gets or sets the maximum volume of a single order; larger orders are rejected.
public int MaxOrderSize { get; set; }
Property Value
- int
MaxPositionSize
Gets or sets the maximum absolute volume of a position in one security; an order that would exceed it is rejected.
public int MaxPositionSize { get; set; }
Property Value
- int
MaxPositions
Gets or sets the maximum number of open positions; an order that would open a position beyond it is rejected.
public int MaxPositions { get; set; }
Property Value
- int
MaxTotalPositionSize
Gets or sets the maximum sum of the absolute volumes of all positions; an order that would exceed it is rejected.
public int MaxTotalPositionSize { get; set; }
Property Value
- int
MaxUnrealizedPnL
Gets or sets the maximum open loss, a positive amount: when the open PnL falls to its negative value, all positions are closed.
public decimal MaxUnrealizedPnL { get; set; }
Property Value
- decimal
OvernightPositions
Gets or sets whether positions may be held after the exchange session ends; when false, open positions on the exchange are closed at the end of its session. true by default.
public bool OvernightPositions { get; set; }
Property Value
- bool
ResetPnlTime
Gets or sets the server time of day after which the closed (realized) PnL of the portfolio is reset to zero once per day.
public TimeSpan ResetPnlTime { get; set; }
Property Value
- TimeSpan
SecurityRoutes
Gets the rules that route orders of the portfolios to real accounts by security code and exchange.
public SecurityRouteCache SecurityRoutes { get; }
Property Value
SessionBeginTime
Gets or sets the server time of day when IntradayLeverage starts to apply. When both this and SessionEndTime are zero, Leverage applies all day.
public TimeSpan SessionBeginTime { get; set; }
Property Value
- TimeSpan
SessionEndTime
Gets or sets the server time of day after which Leverage applies again instead of IntradayLeverage.
public TimeSpan SessionEndTime { get; set; }
Property Value
- TimeSpan
StopEvaluationOnMaxTotalPositionSize
Gets or sets whether exceeding MaxTotalPositionSize also suspends the portfolio, closing its positions, instead of only rejecting the order.
public bool StopEvaluationOnMaxTotalPositionSize { get; set; }
Property Value
- bool
SuspendOnDrawdown
Gets or sets whether the portfolio is also suspended (active orders cancelled, trading blocked) when a drawdown, balance or PnL limit closes its positions.
public bool SuspendOnDrawdown { get; set; }
Property Value
- bool
TrailingDrawdown
Gets or sets the maximum drop of equity from its highest value: when the equity falls to the maximum equity minus this amount, all positions are closed.
public decimal TrailingDrawdown { get; set; }
Property Value
- decimal
Methods
OnPropertyChanged(string)
Raises the PropertyChanged event.
protected virtual void OnPropertyChanged(string propertyName)
Parameters
propertyNamestringThe name of the changed property.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Events
PropertyChanged
Occurs when a property value changes.
Added in ATAS 8.0.15.
public event PropertyChangedEventHandler? PropertyChanged
Event Type
- PropertyChangedEventHandler