ATAS
Loading...
Searching...
No Matches
ATAS.Strategies.ATM.StopProfit Class Reference
Inheritance diagram for ATAS.Strategies.ATM.StopProfit:
[legend]
Collaboration diagram for ATAS.Strategies.ATM.StopProfit:
[legend]

Public Member Functions

 StopProfit ()
 
async Task SetCustomStopOrTake (PriceUnit? stop, PriceUnit? take)
 
- Public Member Functions inherited from ATAS.Strategies.ATM.BaseStopProfitStrategy< StopProfit, SimpleStopProfitSettings >
void SetSettings (TSettings settings)
 
new TSettings GetSettings ()
 
bool IEnumerable< string > Errors IsValidSettings (TSettings settings, decimal? expectedPositionVolume=null, decimal? expectedPositionPrice=null)
 
Task SetCustomStopOrTake (PriceUnit? stop, PriceUnit? take)
 
- Public Member Functions inherited from ATAS.Strategies.ATM.IStopProfitStrategy< SimpleStopProfitSettings >
void SetSettings (TSettings settings)
 
new TSettings GetSettings ()
 
bool IEnumerable< string > Errors IsValidSettings (TSettings settings, decimal? expectedPositionVolume=null, decimal? expectedPositionPrice=null)
 

Protected Member Functions

override StopProfit CreateNew ()
 
override void CommitChanges (StopProfit model, bool cloneOrders)
 
override SimpleStopProfitSettings OnGetSettings ()
 
override void OnSetSettings (SimpleStopProfitSettings settings)
 
override ICollection< string > OnIsValidSettings (SimpleStopProfitSettings settings, decimal positionVolume, decimal positionPrice, decimal currentPrice)
 
override void OnResetStopTakeOrderId ()
 
override void OnResetCustomStopAndTakePrices ()
 
override void DisableStopAndTake ()
 
override void OnAttachStopAndTakeOrdersFailed ()
 
override void OnProcessOrder (Order order)
 
override async Task OnCancelAll (bool retryOnError)
 
override async Task< bool > OnCancelSecondOrder (Order order)
 
override bool SetStopOrTakeCancelledManually (Order order, string type)
 
override bool SetStopOrTakeCustomPrice (Order currentStopOrTake, Order newOrder)
 
override bool IsStopOrder (Order order)
 
override bool IsTakeOrder (Order order)
 
override async Task OnProcess (ChangesInfo info)
 
override void OnCurrentPositionChanged ()
 
override void OnPnLChanged (int ticks)
 
- Protected Member Functions inherited from ATAS.Strategies.ATM.BaseStopProfitStrategy< StopProfit, SimpleStopProfitSettings >
async Task ProcessAfterDelay (TimeSpan? delay=null)
 
void Process (bool isPositionChanged=false, bool isOrdersChanged=false, bool isSettingsChanged=false)
 
decimal GetPriceValue (decimal price, PriceUnit value, decimal sign)
 
bool IsEquals (Order first, Order second, bool isStop, bool comparePrices)
 
Order TryAttachOrder (string type, Order order, StrategyOrderId orderId, string prefix)
 
Order CreateStopOrder (OrderDirections direction, decimal sl, decimal volume, string prefix)
 
Order CreateTakeOrder (OrderDirections direction, decimal tp, decimal volume, string prefix)
 
async Task< bool > TryCancelStopOrTake (string type, Order order, string message, string prefix, bool retryOnError)
 
async Task< OrderTryProcessStopOrTake (string type, Order oldOrder, OrderDirections direction, PriceUnit? currentValue, int positionSign, decimal volume, string prefix, bool isPositionChanged)
 
async Task< bool > TryCancelSecondOrder (string type, Order order, string prefix)
 
void ResetCustomStopAndTakePrices ()
 
void ResetWatchState ()
 
virtual void OnProcessOrder (Order order)
 
abstract Task OnCancelAll (bool retryOnError)
 
abstract Task< bool > OnCancelSecondOrder (Order order)
 
abstract Task OnProcess (ChangesInfo info)
 
abstract void OnResetCustomStopAndTakePrices ()
 
abstract void OnResetStopTakeOrderId ()
 
abstract void DisableStopAndTake ()
 
abstract void OnAttachStopAndTakeOrdersFailed ()
 
abstract bool SetStopOrTakeCustomPrice (Order currentStopOrTake, Order newOrder)
 
abstract bool SetStopOrTakeCancelledManually (Order order, string type)
 
abstract void OnSetSettings (TSettings settings)
 
abstract TSettings OnGetSettings ()
 
abstract ICollection< string > OnIsValidSettings (TSettings settings, decimal positionVolume, decimal positionPrice, decimal currentPrice)
 
override async Task OnStarted ()
 Called when the strategy is started from StrategyStates.Stopped state.
 
override async Task OnStartedFromWatch ()
 Called when the strategy is started from StrategyStates.Watch state.
 
override async Task OnStopping ()
 Called when the strategy is stopping.
 
override Task OnRetry ()
 
override async Task OnCancel ()
 
override Task OnResetOrders ()
 
override void OnCurrentPositionChanged ()
 Called when the volume of the current position changes.
 
override async Task OnModifyOrder (Order order, Order newOrder, bool isAutomated)
 Called when an existing order is modified.
 
override async Task OnCancelOrder (Order order, bool isAutomated)
 Called when an order is canceled.
 
override async Task OnCancelOrdersAsync (IEnumerable< Order > orders)
 
override void OnNewOrder (Order order)
 Called when a new order is added.
 
override void OnOrderChanged (Order order)
 Called when an existing order is changed.
 
override void OnSetStopProfitSettings (IStopProfitSettings settings)
 
override IStopProfitSettings OnGetStopProfitSettings ()
 
 override (bool IsValid, IEnumerable< string > Errors) OnIsValidStopProfitSettings(IStopProfitSettings settings
 

Properties

override bool IsStopOrderAttached [get]
 
override bool IsTakeOrderAttached [get]
 
override bool HasActiveOrders [get]
 
StopProfitSettings TakeProfit [get]
 
StopProfitSettings StopLoss [get]
 
PriceUnitCurrentStop [get]
 
PriceUnitCurrentTake [get]
 
StrategyOrderIdStopOrderId [get]
 
StrategyOrderIdTakeOrderId [get]
 
BreakevenSettings Breakeven [get, set]
 
TrailingStopSettings TrailingStop [get, set]
 
- Properties inherited from ATAS.Strategies.ATM.BaseStopProfitStrategy< StopProfit, SimpleStopProfitSettings >
abstract bool IsStopOrderAttached [get]
 
abstract bool IsTakeOrderAttached [get]
 
TimeSpan ProcessTimeout [get, set]
 
TimeSpan AttachOrdersPeriod [get]
 
TimeSpan RetryPeriodOnConnectionError [get]
 
TimeSpan RetryPeriodOnOrderError [get]
 
TimeSpan RetryPeriod [get]
 
- Properties inherited from ATAS.Strategies.ATM.ISimpleStopProfitStrategy
StopProfitSettings StopLoss [get]
 
StopProfitSettings TakeProfit [get]
 
TrailingStopSettings TrailingStop [get]
 
BreakevenSettings Breakeven [get]
 
PriceUnitCurrentStop [get]
 
PriceUnitCurrentTake [get]
 

Additional Inherited Members

- Public Attributes inherited from ATAS.Strategies.ATM.BaseStopProfitStrategy< StopProfit, SimpleStopProfitSettings >
bool IsValid
 
- Public Attributes inherited from ATAS.Strategies.ATM.IStopProfitStrategy< SimpleStopProfitSettings >
bool IsValid
 

Constructor & Destructor Documentation

◆ StopProfit()

ATAS.Strategies.ATM.StopProfit.StopProfit ( )

Member Function Documentation

◆ CommitChanges()

override void ATAS.Strategies.ATM.StopProfit.CommitChanges ( StopProfit  model,
bool  cloneOrders 
)
protected

◆ CreateNew()

override StopProfit ATAS.Strategies.ATM.StopProfit.CreateNew ( )
protected

◆ DisableStopAndTake()

override void ATAS.Strategies.ATM.StopProfit.DisableStopAndTake ( )
protectedvirtual

◆ IsStopOrder()

override bool ATAS.Strategies.ATM.StopProfit.IsStopOrder ( Order  order)
protected

◆ IsTakeOrder()

override bool ATAS.Strategies.ATM.StopProfit.IsTakeOrder ( Order  order)
protected

◆ OnAttachStopAndTakeOrdersFailed()

override void ATAS.Strategies.ATM.StopProfit.OnAttachStopAndTakeOrdersFailed ( )
protectedvirtual

◆ OnCancelAll()

override async Task ATAS.Strategies.ATM.StopProfit.OnCancelAll ( bool  retryOnError)
protectedvirtual

◆ OnCancelSecondOrder()

override async Task< bool > ATAS.Strategies.ATM.StopProfit.OnCancelSecondOrder ( Order  order)
protectedvirtual

◆ OnCurrentPositionChanged()

override void ATAS.Strategies.ATM.StopProfit.OnCurrentPositionChanged ( )
protected

◆ OnGetSettings()

override SimpleStopProfitSettings ATAS.Strategies.ATM.StopProfit.OnGetSettings ( )
protectedvirtual

◆ OnIsValidSettings()

override ICollection< string > ATAS.Strategies.ATM.StopProfit.OnIsValidSettings ( SimpleStopProfitSettings  settings,
decimal  positionVolume,
decimal  positionPrice,
decimal  currentPrice 
)
protected

◆ OnPnLChanged()

override void ATAS.Strategies.ATM.StopProfit.OnPnLChanged ( int  ticks)
protected

◆ OnProcess()

override async Task ATAS.Strategies.ATM.StopProfit.OnProcess ( ChangesInfo  info)
protectedvirtual

◆ OnProcessOrder()

override void ATAS.Strategies.ATM.StopProfit.OnProcessOrder ( Order  order)
protectedvirtual

◆ OnResetCustomStopAndTakePrices()

override void ATAS.Strategies.ATM.StopProfit.OnResetCustomStopAndTakePrices ( )
protectedvirtual

◆ OnResetStopTakeOrderId()

override void ATAS.Strategies.ATM.StopProfit.OnResetStopTakeOrderId ( )
protectedvirtual

◆ OnSetSettings()

override void ATAS.Strategies.ATM.StopProfit.OnSetSettings ( SimpleStopProfitSettings  settings)
protected

◆ SetCustomStopOrTake()

async Task ATAS.Strategies.ATM.StopProfit.SetCustomStopOrTake ( PriceUnit stop,
PriceUnit take 
)

◆ SetStopOrTakeCancelledManually()

override bool ATAS.Strategies.ATM.StopProfit.SetStopOrTakeCancelledManually ( Order  order,
string  type 
)
protectedvirtual

◆ SetStopOrTakeCustomPrice()

override bool ATAS.Strategies.ATM.StopProfit.SetStopOrTakeCustomPrice ( Order  currentStopOrTake,
Order  newOrder 
)
protectedvirtual

Property Documentation

◆ Breakeven

BreakevenSettings ATAS.Strategies.ATM.StopProfit.Breakeven
getset

◆ CurrentStop

PriceUnit? ATAS.Strategies.ATM.StopProfit.CurrentStop
get

◆ CurrentTake

PriceUnit? ATAS.Strategies.ATM.StopProfit.CurrentTake
get

◆ HasActiveOrders

override bool ATAS.Strategies.ATM.StopProfit.HasActiveOrders
get

◆ IsStopOrderAttached

override bool ATAS.Strategies.ATM.StopProfit.IsStopOrderAttached
getprotected

◆ IsTakeOrderAttached

override bool ATAS.Strategies.ATM.StopProfit.IsTakeOrderAttached
getprotected

◆ StopLoss

StopProfitSettings ATAS.Strategies.ATM.StopProfit.StopLoss
get

◆ StopOrderId

StrategyOrderId? ATAS.Strategies.ATM.StopProfit.StopOrderId
get

◆ TakeOrderId

StrategyOrderId? ATAS.Strategies.ATM.StopProfit.TakeOrderId
get

◆ TakeProfit

StopProfitSettings ATAS.Strategies.ATM.StopProfit.TakeProfit
get

◆ TrailingStop

TrailingStopSettings ATAS.Strategies.ATM.StopProfit.TrailingStop
getset

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