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
Position
The current position for the selected security and portfolio.
Position? Position { get; }
Property Value
Security
The selected security.
Security? Security { get; }
Property Value
TPlusLimit
The T+ limits for the selected security.
TPlusLimits? TPlusLimit { get; }
Property Value
TradingVolumeInfo
Gets ITradingVolumeInfo for current Security.
ITradingVolumeInfo? TradingVolumeInfo { get; }
Property Value
Methods
CancelOrder(Order, bool, bool)
Cancels an existing order.
[Obsolete("Use CancelOrderAsync instead.")]
void CancelOrder(Order order, bool askConfirmation = true, bool checkOrderStates = true)
Parameters
orderOrderThe order to cancel.
askConfirmationboolSet to true to ask for confirmation before cancelling the order.
checkOrderStatesboolSet 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
orderOrderThe order to cancel.
askConfirmationboolSet to true to ask for confirmation before cancelling the order.
checkOrderStatesboolSet 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
positionPositionThe position to close.
askConfirmationboolSet to true to ask for confirmation before closing the position.
checkOrderStatesboolSet 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
positionPositionThe position to close.
askConfirmationboolSet to true to ask for confirmation before closing the position.
checkOrderStatesboolSet to true to check order states before closing the position.
Returns
- Task
GetSecurityTradingOptions()
Gets ISecurityTradingOptions for current Security.
ISecurityTradingOptions? GetSecurityTradingOptions()
Returns
IsStopLossOrder(Order)
Checks if Order is Stop-Loss order.
bool IsStopLossOrder(Order order)
Parameters
Returns
- bool
Returns
trueif the order is Stop-Loss, otherwisefalse.
IsTakeProfitOrder(Order)
Checks if Order is Take-Profit order.
bool IsTakeProfitOrder(Order order)
Parameters
Returns
- bool
Returns
trueif the order is Take-Profit, otherwisefalse.
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
orderOrderThe order to modify.
newOrderOrderThe modified order.
askConfirmationboolSet to true to ask for confirmation before modifying the order.
checkOrderStatesboolSet 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
orderOrderThe order to modify.
newOrderOrderThe modified order.
askConfirmationboolSet to true to ask for confirmation before modifying the order.
checkOrderStatesboolSet 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
orderOrderThe order to open.
setDefaultQuantityboolSet to true to use default quantity.
askConfirmationboolSet to true to ask for confirmation before opening the order.
checkOrderStatesboolSet 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
orderOrderThe order to open.
setDefaultQuantityboolSet to true to use default quantity.
askConfirmationboolSet to true to ask for confirmation before opening the order.
checkOrderStatesboolSet 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
valuePriceUnitStop-Loss value.
Returns
- Task
SetTakeProfit(PriceUnit)
Sets a new Take-Profit value.
Task SetTakeProfit(PriceUnit value)
Parameters
valuePriceUnitTake-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
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>