mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-15 11:48:09 +00:00
MtApi5: added fleld 'Flags' into MqlTick
This commit is contained in:
@@ -5,12 +5,18 @@ namespace MtApi5
|
||||
public class MqlTick
|
||||
{
|
||||
public MqlTick(DateTime time, double bid, double ask, double last, ulong volume)
|
||||
: this(time, bid, ask, last, volume, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public MqlTick(DateTime time, double bid, double ask, double last, ulong volume, ENUM_TICK_FLAGS flags)
|
||||
{
|
||||
MtTime = Mt5TimeConverter.ConvertToMtTime(time);
|
||||
this.bid = bid;
|
||||
this.ask = ask;
|
||||
this.last = last;
|
||||
this.volume = volume;
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
public MqlTick()
|
||||
@@ -27,6 +33,7 @@ namespace MtApi5
|
||||
last = tick.Last;
|
||||
volume = tick.Volume;
|
||||
volume_real = tick.VolumeReal;
|
||||
flags = (ENUM_TICK_FLAGS)tick.Flags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +44,7 @@ namespace MtApi5
|
||||
public double last { get; set; } // Price of the last deal (Last)
|
||||
public ulong volume { get; set; } // Volume for the current Last price
|
||||
public double volume_real { get; set; } // Volume for the current Last price with greater accuracy
|
||||
public ENUM_TICK_FLAGS flags { get; set; } // Tick flags (used for analyzing to find out what data have been changed)
|
||||
|
||||
public DateTime time => Mt5TimeConverter.ConvertFromMtTime(MtTime);
|
||||
}
|
||||
|
||||
@@ -862,6 +862,18 @@ namespace MtApi5
|
||||
STO_CLOSECLOSE = 1 //Calculation is based on Close/Close prices
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ENUM_TICK_FLAGS
|
||||
{
|
||||
TICK_FLAG_NONE = 0,
|
||||
TICK_FLAG_BID = 2, // Tick has changed a Bid price
|
||||
TICK_FLAG_ASK = 4, // Tick has changed an Ask price
|
||||
TICK_FLAG_LAST = 8, // Tick has changed the last deal price
|
||||
TICK_FLAG_VOLUME = 16, // Tick has changed a volume
|
||||
TICK_FLAG_BUY = 32, // Tick is a result of a buy deal
|
||||
TICK_FLAG_SELL = 64 // Tick is a result of a sell deal
|
||||
}
|
||||
|
||||
#endregion //Price Constants
|
||||
|
||||
#region Smoothing Methods
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
public double Last { get; set; } // Price of the last deal (Last)
|
||||
public ulong Volume { get; set; } // Volume for the current Last price
|
||||
public double VolumeReal { get; set; } // Volume for the current Last price with greater accuracy
|
||||
public uint Flags { get; set; } // Tick flags
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user