Table of Contents

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
IPersistable
INotifyPropertyChangedEx
ICloneable<Strategy>
Derived
Inherited Members
Extension Methods

Constructors

QuotingStrategy(Order)

Initialize QuotingStrategy.

protected QuotingStrategy(Order order)

Parameters

order Order

Quoting order.

QuotingStrategy(Sides, decimal)

Initialize QuotingStrategy.

protected QuotingStrategy(Sides quotingDirection, decimal quotingVolume)

Parameters

quotingDirection Sides

Quoting direction.

quotingVolume decimal

Total quoting volume.

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

decimal?

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

bool

IsTimeOut

Is the TimeOut occurred.

protected bool IsTimeOut { get; }

Property Value

bool

LastTradePrice

Last trade price.

protected decimal? LastTradePrice { get; }

Property Value

decimal?

LeftVolume

The volume which is left to fulfill before the quoting end.

[Browsable(false)]
public decimal LeftVolume { get; }

Property Value

decimal

Order

The order with which the quoting strategy is currently operating.

[Browsable(false)]
public virtual Order Order { get; }

Property Value

Order

QuotingDirection

Quoting direction.

public Sides QuotingDirection { get; set; }

Property Value

Sides

QuotingVolume

Total quoting volume.

public virtual decimal QuotingVolume { get; set; }

Property Value

decimal

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

TimeSpan

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

bool

Methods

GetFilteredQuotes(Sides)

To get the order book filtered FilteredMarketDepth.

protected QuoteChange[] GetFilteredQuotes(Sides side)

Parameters

side Sides

The 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 DateTimeOffset

Current time.

Returns

bool

Check result.

NeedFinish()

Whether the quoting can be stopped.

protected virtual bool NeedFinish()

Returns

bool

true it is possible, otherwise, false.

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 DateTimeOffset

Current 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 decimal

New 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.

NeedQuoting(decimal?, decimal?, decimal)

Should the order be quoted.

protected virtual decimal? NeedQuoting(decimal? currentPrice, decimal? currentVolume, decimal newVolume)

Parameters

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 decimal

New 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()

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()

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()

To initiate the quoting.

protected virtual void ProcessQuoting()

ProcessQuoting(DateTimeOffset)

To initiate the quoting.

protected virtual void ProcessQuoting(DateTimeOffset currentTime)

Parameters

currentTime DateTimeOffset

Current time.

ProcessTimeOut()

The TimeOut occurrence event handler.

protected virtual void ProcessTimeOut()

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 Order

The quoted order.