Table of Contents

Interface ITradingManager

Namespace
ATAS.Indicators
Assembly
ATAS.Indicators.dll

Interface representing a trading manager for handling trading-related operations.

public interface ITradingManager
Extension Methods

Properties

IsStopLossModeActivated

Indicates whether the Stop-Loss mode is activated.

bool IsStopLossModeActivated { get; }

Property Value

bool

IsTakeProfitModeActivated

Indicates whether the Take-Profit mode is activated.

bool IsTakeProfitModeActivated { get; }

Property Value

bool

MyTrades

Collection of MyTrade for the selected security and portfolio.

IEnumerable<MyTrade> MyTrades { get; }

Property Value

IEnumerable<MyTrade>

Orders

Collection of orders for the selected security and portfolio.

IEnumerable<Order> Orders { get; }

Property Value

IEnumerable<Order>

Portfolio

The selected portfolio.

Portfolio? Portfolio { get; }

Property Value

Portfolio

Position

The current position for the selected security and portfolio.

Position? Position { get; }

Property Value

Position

Security

The selected security.

Security? Security { get; }

Property Value

Security

TPlusLimit

The T+ limits for the selected security.

TPlusLimits? TPlusLimit { get; }

Property Value

TPlusLimits?

TradingVolumeInfo

Gets ITradingVolumeInfo for current Security.

ITradingVolumeInfo? TradingVolumeInfo { get; }

Property Value

ITradingVolumeInfo

Methods

CancelOrder(Order, bool, bool)

Cancels an existing order.

[Obsolete("Use CancelOrderAsync instead.")]
void CancelOrder(Order order, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to cancel.

askConfirmation bool

Set to true to ask for confirmation before cancelling the order.

checkOrderStates bool

Set to true to check order states before cancelling the order.

CancelOrderAsync(Order, bool, bool)

Cancels an existing order.

Task CancelOrderAsync(Order order, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to cancel.

askConfirmation bool

Set to true to ask for confirmation before cancelling the order.

checkOrderStates bool

Set to true to check order states before cancelling the order.

Returns

Task

ClosePosition(Position, bool, bool)

Closes the specified position.

[Obsolete("Use ClosePositionAsync instead.")]
bool ClosePosition(Position position, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

position Position

The position to close.

askConfirmation bool

Set to true to ask for confirmation before closing the position.

checkOrderStates bool

Set to true to check order states before closing the position.

Returns

bool

ClosePositionAsync(Position, bool, bool)

Closes the specified position.

Task ClosePositionAsync(Position position, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

position Position

The position to close.

askConfirmation bool

Set to true to ask for confirmation before closing the position.

checkOrderStates bool

Set to true to check order states before closing the position.

Returns

Task

GetSecurityTradingOptions()

ISecurityTradingOptions? GetSecurityTradingOptions()

Returns

ISecurityTradingOptions

IsStopLossOrder(Order)

Checks if Order is Stop-Loss order.

bool IsStopLossOrder(Order order)

Parameters

order Order

The Order to check.

Returns

bool

Returns true if the order is Stop-Loss, otherwise false.

IsTakeProfitOrder(Order)

Checks if Order is Take-Profit order.

bool IsTakeProfitOrder(Order order)

Parameters

order Order

The Order to check.

Returns

bool

Returns true if the order is Take-Profit, otherwise false.

ModifyOrder(Order, Order, bool, bool)

Modifies an existing order.

[Obsolete("Use ModifyOrderAsync instead.")]
void ModifyOrder(Order order, Order newOrder, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to modify.

newOrder Order

The modified order.

askConfirmation bool

Set to true to ask for confirmation before modifying the order.

checkOrderStates bool

Set to true to check order states before modifying the order.

ModifyOrderAsync(Order, Order, bool, bool)

Modifies an existing order.

Task ModifyOrderAsync(Order order, Order newOrder, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to modify.

newOrder Order

The modified order.

askConfirmation bool

Set to true to ask for confirmation before modifying the order.

checkOrderStates bool

Set to true to check order states before modifying the order.

Returns

Task

OpenOrder(Order, bool, bool, bool)

Opens a new order for trading.

[Obsolete("Use OpenOrderAsync instead.")]
void OpenOrder(Order order, bool setDefaultQuantity, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to open.

setDefaultQuantity bool

Set to true to use default quantity.

askConfirmation bool

Set to true to ask for confirmation before opening the order.

checkOrderStates bool

Set to true to check order states before opening the order.

OpenOrderAsync(Order, bool, bool, bool)

Opens a new order for trading.

Task OpenOrderAsync(Order order, bool setDefaultQuantity, bool askConfirmation = true, bool checkOrderStates = true)

Parameters

order Order

The order to open.

setDefaultQuantity bool

Set to true to use default quantity.

askConfirmation bool

Set to true to ask for confirmation before opening the order.

checkOrderStates bool

Set to true to check order states before opening the order.

Returns

Task

SetBreakeven()

Sets a Stop-Loss to breakeven.

Task SetBreakeven()

Returns

Task

SetStopLoss(PriceUnit)

Sets a new Stop-Loss value.

Task SetStopLoss(PriceUnit value)

Parameters

value PriceUnit

Stop-Loss value.

Returns

Task

SetTakeProfit(PriceUnit)

Sets a new Take-Profit value.

Task SetTakeProfit(PriceUnit value)

Parameters

value PriceUnit

Take-Profit value.

Returns

Task

Events

NewMyTrade

Event that is raised when a new MyTrade is added.

event Action<MyTrade> NewMyTrade

Event Type

Action<MyTrade>

NewOrder

Event that is raised when a new order is added.

event Action<Order> NewOrder

Event Type

Action<Order>

OrderCancelFailed

Event that is raised when order cancellation fails.

event Action<Order, string> OrderCancelFailed

Event Type

Action<Order, string>

OrderChanged

Event that is raised when an order is modified.

event Action<Order> OrderChanged

Event Type

Action<Order>

OrderModifyFailed

Event that is raised when order modification fails.

event Action<Order, Order, string> OrderModifyFailed

Event Type

Action<Order, Order, string>

OrderRegisterFailed

Event that is raised when order registration fails.

event Action<Order, string> OrderRegisterFailed

Event Type

Action<Order, string>

PortfolioChanged

Event that is raised when the selected portfolio is changed: on every update of its data (balance, PnL, margin) as well as when another portfolio is selected. Use PortfolioSelected to react to the selection only.

event Action<Portfolio> PortfolioChanged

Event Type

Action<Portfolio>

PortfolioSelected

Event that is raised when a portfolio is selected.

event Action<Portfolio> PortfolioSelected

Event Type

Action<Portfolio>

PositionChanged

Event that is raised when the position is changed.

event Action<Position> PositionChanged

Event Type

Action<Position>

SecuritySelected

Event that is raised when a security is selected.

event Action<Security> SecuritySelected

Event Type

Action<Security>