mirror of
https://github.com/StockSharp/StockSharp.git
synced 2026-12-06 01:22:11 +00:00
The wire both the server and the connector speak was declared in a server module, so a client had to compile against a server assembly to know its own record layout. The subscribe needed no message of its own: a DataType is a message type plus an argument, so an indicator is which one, on which series. That asks the argument to be a value - DataType caches its hash and compares by Arg.Equals - so the specification is one now, and two clients asking for the same indicator get the same data type and share one computation. Numbers are stored one way, because 20 written in code is an int and 20 off a JSON frame is a long. The warm-up needed none either: a subscription already says where history ends, and warm-up and live values are the same values. Only the names of the outputs survive it, in a message sent once ahead of them - values carry several series positionally and a client cannot work out which is which. The wire keeps its indicatorSubscribe command.
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
namespace StockSharp.Messages;
|
|
|
|
/// <summary>
|
|
/// What the values of an indicator subscription mean, sent once before any of them.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// An indicator can produce several series at once - a band has an upper, a middle and a lower one -
|
|
/// and <see cref="IndicatorPoint.Values"/> carries them positionally. Which position is which
|
|
/// follows from the indicator itself, which the client cannot know, so it is said once here rather
|
|
/// than repeated on every value.
|
|
/// </remarks>
|
|
public class IndicatorInfoMessage : Message, IOriginalTransactionIdMessage, ISecurityIdMessage
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="IndicatorInfoMessage"/> class.
|
|
/// </summary>
|
|
public IndicatorInfoMessage()
|
|
: base(MessageTypes.IndicatorInfo)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public long OriginalTransactionId { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
public SecurityId SecurityId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Names of the value series, in the order <see cref="IndicatorPoint.Values"/> carries them.
|
|
/// </summary>
|
|
public string[] OutputNames { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
public override Message Clone()
|
|
{
|
|
var clone = new IndicatorInfoMessage
|
|
{
|
|
OriginalTransactionId = OriginalTransactionId,
|
|
SecurityId = SecurityId,
|
|
OutputNames = OutputNames?.ToArray(),
|
|
};
|
|
|
|
CopyTo(clone);
|
|
return clone;
|
|
}
|
|
}
|