Class QuotingStrategy
- Namespace
- StockSharp.Algo.Strategies.Quoting
- Assembly
- StockSharp.Algo.dll
Base quoting strategy class.
public abstract class QuotingStrategy : Strategy, IPersistable, INotifyPropertyChangedEx, INotifyPropertyChanged, IMarketRuleContainer, ILogReceiver, ILogSource, IDisposable, ICloneable<Strategy>, ICloneable, IMarketDataProvider, ISubscriptionProvider, ISecurityProvider, ISecurityMessageProvider, ITransactionProvider, IPositionProvider, IPortfolioProvider, IScheduledTask
- Inheritance
-
QuotingStrategy
- Implements
-
IPersistableINotifyPropertyChangedExICloneable<Strategy>
- Derived
- Inherited Members
- Extension Methods
Constructors
QuotingStrategy(Order)
Initialize QuotingStrategy.
protected QuotingStrategy(Order order)
Parameters
order
OrderQuoting order.
QuotingStrategy(Sides, decimal)
Initialize QuotingStrategy.
protected QuotingStrategy(Sides quotingDirection, decimal quotingVolume)
Parameters
Properties
BestPrice
To get the preferrable quoting price. If it is impossible to calculate the it at the moment, then null will be returned.
protected virtual decimal? BestPrice { get; }
Property Value
IsSupportAtomicReRegister
Gets a value indicating whether the re-registration orders via the method ReRegisterOrder(Order, Order) as a single transaction. The default is enabled.
public bool IsSupportAtomicReRegister { get; set; }
Property Value
LastTradePrice
Last trade price.
protected decimal? LastTradePrice { get; }
Property Value
LeftVolume
The volume which is left to fulfill before the quoting end.
[Browsable(false)]
public decimal LeftVolume { get; }
Property Value
Order
The order with which the quoting strategy is currently operating.
[Browsable(false)]
public virtual Order Order { get; }
Property Value
QuotingDirection
Quoting direction.
public Sides QuotingDirection { get; set; }
Property Value
QuotingVolume
Total quoting volume.
public virtual decimal QuotingVolume { get; set; }
Property Value
TimeOut
The time limit during which the quoting should be fulfilled. If the total volume of QuotingVolume will not be fulfilled by this time, the strategy will stop operating.
public TimeSpan TimeOut { get; set; }
Property Value
Remarks
By default, the limit is disabled and it is equal to Zero.
UseLastTradePrice
To use the last trade price, if the information in the order book is missed. The default is enabled.
public bool UseLastTradePrice { get; set; }
Property Value
Methods
GetFilteredQuotes(Sides)
To get the order book filtered FilteredMarketDepth.
protected QuoteChange[] GetFilteredQuotes(Sides side)
Parameters
side
SidesThe order book side (bids or offers).
Returns
- QuoteChange[]
The filtered order book.
GetNewVolume()
To get a new volume for an order.
protected virtual decimal GetNewVolume()
Returns
- decimal
The new volume for an order.
GetNotificationRules()
To get a list of rules on which the quoting will respond.
protected virtual IEnumerable<IMarketRule> GetNotificationRules()
Returns
- IEnumerable<IMarketRule>
Rule list.
IsTimeOut(DateTimeOffset)
Is the TimeOut occurred.
protected bool IsTimeOut(DateTimeOffset currentTime)
Parameters
currentTime
DateTimeOffsetCurrent time.
Returns
- bool
Check result.
NeedFinish()
Whether the quoting can be stopped.
protected virtual bool NeedFinish()
Returns
Remarks
By default, the quoting is stopped when all contracts are fulfilled and LeftVolume is equal to 0.
NeedQuoting(DateTimeOffset, decimal?, decimal?, decimal)
Should the order be quoted.
protected virtual decimal? NeedQuoting(DateTimeOffset currentTime, decimal? currentPrice, decimal? currentVolume, decimal newVolume)
Parameters
currentTime
DateTimeOffsetCurrent time.
currentPrice
decimal?The current price. If the value is equal to null then the order is not registered yet.
currentVolume
decimal?The current volume. If the value is equal to null then the order is not registered yet.
newVolume
decimalNew volume.
Returns
- decimal?
The price at which the order will be registered. If the value is equal to null then the quoting is not required.
OnStarted(DateTimeOffset)
The method is called when the Start() method has been called and the ProcessState state has been taken the Started value.
protected override void OnStarted(DateTimeOffset time)
Parameters
time
DateTimeOffset
OnStopping()
The method is called when the ProcessState process state has been taken the Stopping value.
protected override void OnStopping()
ProcessQuoting(DateTimeOffset)
To initiate the quoting.
protected virtual void ProcessQuoting(DateTimeOffset currentTime)
Parameters
currentTime
DateTimeOffsetCurrent time.
ProcessTimeOut(DateTimeOffset)
The TimeOut occurrence event handler.
protected virtual void ProcessTimeOut(DateTimeOffset currentTime)
Parameters
currentTime
DateTimeOffset
RegisterQuotingOrder(Order)
To register the quoted order.
protected virtual void RegisterQuotingOrder(Order order)
Parameters
order
OrderThe quoted order.