2024-02-24 21:33:35 +02:00
|
|
|
using MtApi5.MtProtocol;
|
|
|
|
|
|
|
|
|
|
namespace MtApi5
|
2014-10-31 09:05:52 +02:00
|
|
|
{
|
|
|
|
|
public class MqlTick
|
|
|
|
|
{
|
|
|
|
|
public MqlTick(DateTime time, double bid, double ask, double last, ulong volume)
|
|
|
|
|
{
|
2016-11-05 00:52:52 +02:00
|
|
|
MtTime = Mt5TimeConverter.ConvertToMtTime(time);
|
2014-10-31 09:05:52 +02:00
|
|
|
this.bid = bid;
|
|
|
|
|
this.ask = ask;
|
|
|
|
|
this.last = last;
|
|
|
|
|
this.volume = volume;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-05 00:52:52 +02:00
|
|
|
public MqlTick()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-24 21:33:35 +02:00
|
|
|
internal MqlTick(MtTick? tick)
|
|
|
|
|
{
|
|
|
|
|
if (tick != null)
|
|
|
|
|
{
|
|
|
|
|
MtTime = tick.Time;
|
|
|
|
|
bid = tick.Bid;
|
|
|
|
|
ask = tick.Ask;
|
|
|
|
|
last = tick.Last;
|
|
|
|
|
volume = tick.Volume;
|
|
|
|
|
volume_real = tick.VolumeReal;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-05 00:52:52 +02:00
|
|
|
public long MtTime { get; set; } // Time of the last prices update
|
|
|
|
|
|
|
|
|
|
public double bid { get; set; } // Current Bid price
|
|
|
|
|
public double ask { get; set; } // Current Ask price
|
|
|
|
|
public double last { get; set; } // Price of the last deal (Last)
|
2019-03-18 17:31:54 +02:00
|
|
|
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
|
2016-11-05 00:52:52 +02:00
|
|
|
|
|
|
|
|
public DateTime time => Mt5TimeConverter.ConvertFromMtTime(MtTime);
|
2014-10-31 09:05:52 +02:00
|
|
|
}
|
|
|
|
|
}
|