Files
mika@stocksharp.com 3ce575b384 Let an execution say it states no side
Sides.Buy is the enum's default, so every ExecutionMessage that never touched
Side read back as a buy. Nothing said so and nothing could tell the difference,
which is how a rejected sell went out as FIX tag 54=1: the writer emits the tag
unconditionally and had no value meaning "unstated".

Side is now Sides?, and so is IOrderMessage.Side - an order always has one, a
message reporting on an order need not.

Callers split three ways. Where the message is the only source of truth for an
order - materializing one to send to a venue, building one the receiver has not
seen, signing a fill, booking a row into a side of the book - a missing side is
refused rather than defaulted. Where the side is merely descriptive, the absence
travels. Where it was silently invented, it is now stated: the matching engine
and both emulators left it off sixteen order reports, every one of which the
receiver read as a buy.

Storage keeps its layout. The snapshot record is positional and read without
version branching, so the absence rides in the byte the side already occupies -
Sides has two values and the byte has 254 spare. The transaction stream carries
one bit that cannot express absence, so Version72 writes the nullable form while
older files keep being read through the old branch. The order log throws instead:
a row entering or leaving the book always has a side, and a lifted comparison
would have written Sell for one that did not.

FIX omits tag 54 when the side is unstated. A required tag that is absent is
loud; a required tag that is wrong is not.
2026-08-15 21:14:39 +03:00

52 lines
1.2 KiB
C#

namespace StockSharp.Messages;
/// <summary>
/// Interface describes an order's state message.
/// </summary>
public interface IOrderMessage :
ISecurityIdMessage, ILocalTimeMessage, IServerTimeMessage, IComplexIdMessage,
IGeneratedMessage, ISeqNumMessage, ICurrencyMessage, ISystemMessage
{
/// <summary>
/// <see cref="Sides"/>, or <see langword="null"/> when the message states none.
/// </summary>
Sides? Side { get; }
/// <summary>
/// Order state.
/// </summary>
OrderStates? State { get; }
/// <summary>
/// <see cref="TimeInForce"/>
/// </summary>
TimeInForce? TimeInForce { get; }
/// <summary>
/// Order expiry time. The default is <see langword="null" />, which mean (GTC).
/// </summary>
/// <remarks>
/// If the value is equal <see langword="null" />, order will be GTC (good til cancel). Or uses exact date.
/// </remarks>
DateTime? ExpiryDate { get; set; }
/// <summary>
/// <see cref="Type"/>
/// </summary>
OrderTypes? Type { get; }
/// <summary>
/// Order contracts balance.
/// </summary>
decimal? Balance { get; }
/// <summary>
/// Order price.
/// </summary>
decimal Price { get; }
/// <summary>
/// Number of contracts in the order.
/// </summary>
decimal? Volume { get; }
}