ATAS
Loading...
Searching...
No Matches
ATAS.Strategies.ATM.ATMStrategy< TStrategy > Class Template Referenceabstract
Inheritance diagram for ATAS.Strategies.ATM.ATMStrategy< TStrategy >:
[legend]
Collaboration diagram for ATAS.Strategies.ATM.ATMStrategy< TStrategy >:
[legend]

Public Member Functions

Task RetryAsync ()
 
Task CancelAsync ()
 
Task ResetOrdersAsync ()
 
Task CancelOrdersAsync (IEnumerable< Order > orders)
 
bool IsStopLoss (Order order)
 
bool IsTakeProfit (Order order)
 
IATMStrategy Clone (bool cloneOrders=true)
 
void SetSettings (IStopProfitSettings settings)
 
IStopProfitSettings GetSettings ()
 
bool IEnumerable< string > Errors IsValidSettings (IStopProfitSettings settings, decimal? expectedPositionVolume=null, decimal? expectedPositionPrice=null)
 
- Public Member Functions inherited from ATAS.Strategies.Strategy
void Start ()
 
void Stop ()
 
async Task StartAsync ()
 Starts the strategy, allowing it to execute its trading logic.
 
async Task WatchAsync ()
 
async Task StartFromWatchAsync ()
 
async Task StopAsync ()
 Stops the strategy, terminating its execution and releasing any resources.
 
async void OpenOrder (Order order, bool isAutomated=true)
 Открыть ордер.
 
async Task OpenOrderAsync (Order order, bool isAutomated=true)
 Открыть ордер.
 
async void ModifyOrder (Order order, Order neworder, bool isAutomated=true)
 Изменить ордер.
 
async Task ModifyOrderAsync (Order order, Order neworder, bool isAutomated=true)
 Изменить ордер.
 
async void CancelOrder (Order order, bool isAutomated=true)
 Отменить ордер.
 
async Task CancelOrderAsync (Order order, bool isAutomated=true)
 Отменить ордер.
 
Task StartAsync ()
 Starts the strategy, allowing it to execute its trading logic.
 
Task StopAsync ()
 Stops the strategy, terminating its execution and releasing any resources.
 
- Public Member Functions inherited from ATAS.Strategies.ATM.IATMStrategy
Task WatchAsync ()
 
Task StartFromWatchAsync ()
 
Task RetryAsync ()
 
Task CancelAsync ()
 
Task ResetOrdersAsync ()
 
bool IsStopLoss (Order order)
 
bool IsTakeProfit (Order order)
 
Task OpenOrderAsync (Order order, bool isAutomated=true)
 
Task ModifyOrderAsync (Order order, Order newOrder, bool isAutomated=true)
 
Task CancelOrderAsync (Order order, bool isAutomated=true)
 
Task CancelOrdersAsync (IEnumerable< Order > orders)
 
IATMStrategy Clone (bool cloneOrders=true)
 
void SetSettings (IStopProfitSettings settings)
 
IStopProfitSettings GetSettings ()
 
bool IEnumerable< string > Errors IsValidSettings (IStopProfitSettings settings, decimal? expectedPositionVolume=null, decimal? expectedPositionPrice=null)
 

Public Attributes

bool IsValid
 
- Public Attributes inherited from ATAS.Strategies.ATM.IATMStrategy
bool IsValid
 

Protected Member Functions

virtual Task OnRetry ()
 
virtual Task OnCancel ()
 
virtual Task OnResetOrders ()
 
virtual TStrategy CreateNew ()
 
virtual void CommitChanges (TStrategy model, bool cloneOrders)
 
abstract Task OnCancelOrdersAsync (IEnumerable< Order > orders)
 
abstract bool IsStopOrder (Order order)
 
abstract bool IsTakeOrder (Order order)
 
abstract void OnSetStopProfitSettings (IStopProfitSettings settings)
 
abstract IStopProfitSettings OnGetStopProfitSettings ()
 
abstract bool IEnumerable< string > Errors OnIsValidStopProfitSettings (IStopProfitSettings settings, decimal? positionVolume, decimal? positionPrice)
 
void RaiseSettingsChanged ()
 
void ThrowIfNotStarted ()
 
override bool CanUpdateCurrentPosition (Position position)
 Checks if the current position can be updated with the specified position.
 
override void LogParameters ()
 Log current parameters.
 
- Protected Member Functions inherited from ATAS.Strategies.Strategy
 Strategy ()
 
void SetState (StrategyStates state)
 Set strategy state.
 
void SetErrorState (StrategyErrorTypes type, string[] errorDescriptions)
 Set StrategyStates.Error state.
 
void ResetErrorState ()
 Reset error state.
 
void RaisePropertyChanged (string propertyName)
 Raises the PropertyChanged event with the specified property name.
 
void RaiseShowNotification (string message, string title=null, bool isError=false)
 Raises the ShowNotification event with the specified message, title, and error flag.
 
bool SetProperty< TValue > (ref TValue storage, TValue newValue, string propertyName, Action< TValue, TValue > onChanged=null)
 Sets the property with the specified name to the new value and raises the PropertyChanged event if the value has changed.
 
string GetOCOGroup ()
 Generates a unique OCO (One-Cancels-the-Other) group identifier based on the current timestamp.
 
bool CanProcess (Order order)
 Checks if the specified order can be processed by this strategy.
 
ICollection< MyTradeFilterMyTrades (IEnumerable< MyTrade > trades)
 Filters and returns the collection of MyTrade that belong to the current portfolio and security and have occurred after the latest trade time.
 
void UpdateCurrentPosition ()
 Update thr CurrentPosition and AveragePrice values.
 
virtual Task OnStarted ()
 Called when the strategy is started from StrategyStates.Stopped state.
 
virtual Task OnStartedFromWatch ()
 Called when the strategy is started from StrategyStates.Watch state.
 
virtual Task OnStopping ()
 Called when the strategy is stopping.
 
virtual Task OnStopped ()
 Called when the strategy is stopped.
 
virtual Task OnOpenOrder (Order order, bool isAutomated)
 Called when a new order is opened.
 
virtual Task OnModifyOrder (Order order, Order newOrder, bool isAutomated)
 Called when an existing order is modified.
 
virtual Task OnCancelOrder (Order order, bool isAutomated)
 Called when an order is canceled.
 
virtual void OnMarketDepth (IEnumerable< MarketDepth > depths)
 Called when market depth data is received.
 
virtual void OnBestBidAsk (MarketDepth depth)
 Called when the best bid or ask market depth data is received.
 
virtual void OnNewTrade (Trade trade)
 Called when a new trade occurs.
 
virtual void OnNewPortfolio (Portfolio portfolio)
 Called when a new portfolio is added.
 
virtual void OnNewPosition (Position position)
 Called when a new position is added.
 
virtual void OnPositionChanged (Position position)
 Called when an existing position is changed.
 
virtual void OnPnLChanged (int ticks)
 Called when the profit and loss (PnL) changes.
 
virtual void OnNewOrder (Order order)
 Called when a new order is added.
 
virtual void OnOrderChanged (Order order)
 Called when an existing order is changed.
 
virtual void OnOrderRegisterFailed (Order order, string message)
 Called when an order registration fails.
 
virtual void OnOrderCancelFailed (Order order, string message)
 Called when an order cancellation fails.
 
virtual void OnOrderModifyFailed (Order order, Order newOrder, string message)
 Called when an order modification fails.
 
virtual void OnNewMyTrade (MyTrade myTrade)
 Called when a new trade is added to the collection of MyTrade.
 
virtual void OnCurrentPositionChanged ()
 Called when the volume of the current position changes.
 
virtual void OnUpdateStrategyState ()
 Called when the strategy state needs to be updated.
 
virtual bool CanProcess ()
 Checks if the strategy can process operations in the current state.
 
virtual bool CanUpdateCurrentPosition (Position position)
 Checks if the current position can be updated with the specified position.
 
virtual void LogParameters ()
 Log current parameters.
 

Protected Attributes

abstract bool IsValid
 

Properties

abstract bool HasActiveOrders [get]
 
IStrategyMarketDataProvider MarketDataProvider [get, set]
 
TimeInForce TimeInForce [get, set]
 
- Properties inherited from ATAS.Strategies.Strategy
Security Security [get, set]
 Gets or sets the security associated with the strategy.
 
Portfolio Portfolio [get, set]
 Gets or sets the portfolio associated with the strategy.
 
TPlusLimitsTPlusLimit [get, set]
 Gets or sets the T+ limits for the strategy.
 
IDataFeedConnector Connector [get, set]
 Gets or sets the data feed connector for the strategy.
 
IEnumerable< MyTradeMyTrades [get]
 
IEnumerable< OrderOrders [get]
 
Position Position [get, set]
 
decimal CurrentPosition [get]
 Gets the current position volume of the strategy.
 
decimal AveragePrice [get]
 Gets the average price of the strategy's trades.
 
int OpenTicksPnL [get]
 
decimal OpenPnL [get]
 Gets the open profit and loss of the strategy.
 
decimal ClosedPnL [get]
 Gets the closed profit and loss of the strategy.
 
MarketDepth BestBid [get]
 
MarketDepth BestAsk [get]
 
StrategyStates State [get, protected set]
 Gets the current state of the strategy.
 
StrategyStateDescription StateDescription [get]
 
string Name [get, set]
 Gets or sets the name of the strategy.
 
- Properties inherited from ATAS.Strategies.IStrategy
string Name [get, set]
 Gets or sets the name of the strategy.
 
StrategyStates State [get]
 Gets the current state of the strategy.
 
decimal CurrentPosition [get]
 Gets the current position volume of the strategy.
 
decimal AveragePrice [get]
 Gets the average price of the strategy's trades.
 
decimal OpenPnL [get]
 Gets the open profit and loss of the strategy.
 
decimal ClosedPnL [get]
 Gets the closed profit and loss of the strategy.
 
Security Security [get, set]
 Gets or sets the security associated with the strategy.
 
Portfolio Portfolio [get, set]
 Gets or sets the portfolio associated with the strategy.
 
TPlusLimitsTPlusLimit [get, set]
 Gets or sets the T+ limits for the strategy.
 
IDataFeedConnector Connector [get, set]
 Gets or sets the data feed connector for the strategy.
 
- Properties inherited from ATAS.Strategies.ATM.IATMStrategy
bool HasActiveOrders [get]
 
IStrategyMarketDataProvider MarketDataProvider [get, set]
 

Events

EventHandler< EventArgs > SettingsChanged
 
- Events inherited from ATAS.Strategies.Strategy
PropertyChangedEventHandler PropertyChanged
 
EventHandler< StrategyStateChangedEventArgsStateChanged
 
EventHandler< StrategyNotificationEventArgsShowNotification
 
- Events inherited from ATAS.Strategies.IStrategy
EventHandler< StrategyStateChangedEventArgsStateChanged
 Occurs when the state of the strategy changes.
 
EventHandler< StrategyNotificationEventArgsShowNotification
 Occurs when the strategy needs to show a notification or alert.
 
- Events inherited from ATAS.Strategies.ATM.IATMStrategy
EventHandler< EventArgs > SettingsChanged
 

Member Function Documentation

◆ CancelAsync()

Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.CancelAsync ( )

◆ CancelOrdersAsync()

Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.CancelOrdersAsync ( IEnumerable< Order orders)

◆ CanUpdateCurrentPosition()

override bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.CanUpdateCurrentPosition ( Position  position)
protectedvirtual

Checks if the current position can be updated with the specified position.

Parameters
positionThe position to be compared with the current position.
Returns
true if the current position can be updated; otherwise, false.

Reimplemented from ATAS.Strategies.Strategy.

◆ Clone()

IATMStrategy ATAS.Strategies.ATM.ATMStrategy< TStrategy >.Clone ( bool  cloneOrders = true)

◆ CommitChanges()

virtual void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.CommitChanges ( TStrategy  model,
bool  cloneOrders 
)
protectedvirtual

◆ CreateNew()

virtual TStrategy ATAS.Strategies.ATM.ATMStrategy< TStrategy >.CreateNew ( )
protectedvirtual

◆ GetSettings()

◆ IsStopLoss()

bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsStopLoss ( Order  order)

◆ IsStopOrder()

abstract bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsStopOrder ( Order  order)
protectedpure virtual

◆ IsTakeOrder()

abstract bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsTakeOrder ( Order  order)
protectedpure virtual

◆ IsTakeProfit()

bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsTakeProfit ( Order  order)

◆ IsValidSettings()

bool IEnumerable< string > Errors ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsValidSettings ( IStopProfitSettings  settings,
decimal?  expectedPositionVolume = null,
decimal?  expectedPositionPrice = null 
)

◆ LogParameters()

override void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.LogParameters ( )
protectedvirtual

Log current parameters.

Reimplemented from ATAS.Strategies.Strategy.

◆ OnCancel()

virtual Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnCancel ( )
protectedvirtual

◆ OnCancelOrdersAsync()

abstract Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnCancelOrdersAsync ( IEnumerable< Order orders)
protectedpure virtual

◆ OnGetStopProfitSettings()

abstract IStopProfitSettings ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnGetStopProfitSettings ( )
protectedpure virtual

◆ OnIsValidStopProfitSettings()

abstract bool IEnumerable< string > Errors ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnIsValidStopProfitSettings ( IStopProfitSettings  settings,
decimal?  positionVolume,
decimal?  positionPrice 
)
protected

◆ OnResetOrders()

virtual Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnResetOrders ( )
protectedvirtual

◆ OnRetry()

virtual Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnRetry ( )
protectedvirtual

◆ OnSetStopProfitSettings()

abstract void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.OnSetStopProfitSettings ( IStopProfitSettings  settings)
protectedpure virtual

◆ RaiseSettingsChanged()

void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.RaiseSettingsChanged ( )
protected

◆ ResetOrdersAsync()

Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.ResetOrdersAsync ( )

◆ RetryAsync()

Task ATAS.Strategies.ATM.ATMStrategy< TStrategy >.RetryAsync ( )

◆ SetSettings()

void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.SetSettings ( IStopProfitSettings  settings)

◆ ThrowIfNotStarted()

void ATAS.Strategies.ATM.ATMStrategy< TStrategy >.ThrowIfNotStarted ( )
protected

Member Data Documentation

◆ IsValid [1/2]

bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsValid

◆ IsValid [2/2]

abstract bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.IsValid
protected

Property Documentation

◆ HasActiveOrders

abstract bool ATAS.Strategies.ATM.ATMStrategy< TStrategy >.HasActiveOrders
get

◆ MarketDataProvider

◆ TimeInForce

Event Documentation

◆ SettingsChanged

EventHandler<EventArgs> ATAS.Strategies.ATM.ATMStrategy< TStrategy >.SettingsChanged

The documentation for this class was generated from the following file: