mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-28 02:57:56 +00:00
Issue #121: Added original MtTime field to MqlRates (MT5)
This commit is contained in:
@@ -8,6 +8,20 @@ namespace MtApi5
|
||||
public MqlRates(DateTime time, double open, double high, double low, double close, long tick_volume, int spread, long real_volume)
|
||||
{
|
||||
this.time = time;
|
||||
mt_time = Mt5TimeConverter.ConvertToMtTime(time);
|
||||
this.open = open;
|
||||
this.high = high;
|
||||
this.low = low;
|
||||
this.close = close;
|
||||
this.tick_volume = tick_volume;
|
||||
this.spread = spread;
|
||||
this.real_volume = real_volume;
|
||||
}
|
||||
|
||||
internal MqlRates(long time, double open, double high, double low, double close, long tick_volume, int spread, long real_volume)
|
||||
{
|
||||
this.time = Mt5TimeConverter.ConvertFromMtTime(time);
|
||||
mt_time = time;
|
||||
this.open = open;
|
||||
this.high = high;
|
||||
this.low = low;
|
||||
@@ -22,6 +36,7 @@ namespace MtApi5
|
||||
}
|
||||
|
||||
public DateTime time { get; set; } // Period start time
|
||||
public long mt_time { get; set; } // Period start time (original MT time)
|
||||
public double open { get; set; } // Open price
|
||||
public double high { get; set; } // The highest price of the period
|
||||
public double low { get; set; } // The lowest price of the period
|
||||
|
||||
@@ -741,7 +741,7 @@ namespace MtApi5
|
||||
ratesArray = new MqlRates[retVal.Length];
|
||||
for(var i = 0; i < retVal.Length; i++)
|
||||
{
|
||||
ratesArray[i] = new MqlRates(Mt5TimeConverter.ConvertFromMtTime(retVal[i].time)
|
||||
ratesArray[i] = new MqlRates(retVal[i].time
|
||||
, retVal[i].open
|
||||
, retVal[i].high
|
||||
, retVal[i].low
|
||||
@@ -775,7 +775,7 @@ namespace MtApi5
|
||||
ratesArray = new MqlRates[retVal.Length];
|
||||
for (var i = 0; i < retVal.Length; i++)
|
||||
{
|
||||
ratesArray[i] = new MqlRates(Mt5TimeConverter.ConvertFromMtTime(retVal[i].time)
|
||||
ratesArray[i] = new MqlRates(retVal[i].time
|
||||
, retVal[i].open
|
||||
, retVal[i].high
|
||||
, retVal[i].low
|
||||
@@ -809,7 +809,7 @@ namespace MtApi5
|
||||
ratesArray = new MqlRates[retVal.Length];
|
||||
for (var i = 0; i < retVal.Length; i++)
|
||||
{
|
||||
ratesArray[i] = new MqlRates(Mt5TimeConverter.ConvertFromMtTime(retVal[i].time)
|
||||
ratesArray[i] = new MqlRates(retVal[i].time
|
||||
, retVal[i].open
|
||||
, retVal[i].high
|
||||
, retVal[i].low
|
||||
|
||||
@@ -807,7 +807,7 @@ namespace MtApi5TestClient
|
||||
foreach (var rates in result)
|
||||
{
|
||||
TimeSeriesResults.Add(
|
||||
$"time={rates.time}; open={rates.open}; high={rates.high}; low={rates.low}; close={rates.close}; tick_volume={rates.tick_volume}; spread={rates.spread}; real_volume={rates.tick_volume}");
|
||||
$"time={rates.time}; mt_time={rates.mt_time}; open={rates.open}; high={rates.high}; low={rates.low}; close={rates.close}; tick_volume={rates.tick_volume}; spread={rates.spread}; real_volume={rates.tick_volume}");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user