Files
StockSharp/Messages/IndicatorMessage.cs
mika@stocksharp.com 3740c08801 Move the indicator wire messages into core, as ordinary subscriptions
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.
2026-08-17 21:57:23 +03:00

39 lines
907 B
C#

namespace StockSharp.Messages;
/// <summary>
/// One live indicator value tied to a finalized candle and its originating subscription.
/// </summary>
public class IndicatorMessage : Message, IOriginalTransactionIdMessage, ISecurityIdMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="IndicatorMessage"/> class.
/// </summary>
public IndicatorMessage()
: base(MessageTypes.Indicator)
{
}
/// <inheritdoc />
public long OriginalTransactionId { get; set; }
/// <inheritdoc />
public SecurityId SecurityId { get; set; }
/// <summary>Indicator point carried by this message.</summary>
public IndicatorPoint Point { get; set; }
/// <inheritdoc />
public override Message Clone()
{
var clone = new IndicatorMessage
{
OriginalTransactionId = OriginalTransactionId,
SecurityId = SecurityId,
Point = Point?.Clone(),
};
CopyTo(clone);
return clone;
}
}