Current version of trady (3.2.9?) does not do the minute to hour transformation.
First of all - following part of code in IOhlcvDataExtension was changed previously:
var tempCandles = new List<IOhlcv>();
for (int i = 0; i < orderedCandles.Count; i++)
{
var indexTime = orderedCandles[i].DateTime;
if (indexTime >= periodEndTime)
{
periodStartTime = indexTime; // previously: periodEndTime
periodEndTime = periodInstance.NextTimestamp(periodStartTime);
AddComputedCandleToOutput(outputCandles, tempCandles);
tempCandles = new List<IOhlcv>();
}
tempCandles.Add(orderedCandles[i]);
}
The code with the old periodEndTime somehow works better :) After transformation you actually get smaller amount of candles. With indexTime you get the same exactly amount of candles as you had before the transformation. This is issue 1.
So, the problem I am describing next - is actually using the old version of code (with periodStartTime = periodEndTime). You can skip it, if issue 1 is not an issue but a feature?:
string dataString = File.ReadAllText("data.txt");
var data = JsonSerializer.Deserialize<List<Candle>>(dataString);
var transformedTradyCandles = data.Transform<PerMinute, Hourly>();
data.txt
p.s. In order for deserialization to work - you have to have argument-less Candle constructor.
The data is that I passing to transformation is in time frame: 8:40 - 10:02, total of 83 records.
Expected result - 3 candles:
- at 9:00 (aggregated 8:40 - 9:00)
- at 10:00 (aggregated 9:01 - 10:00)
- at 11:00 (aggregated 10:01 - 10:03)
Actual result - 4 candles, wrong time components:
I have not actually compared the amount of Volume. But from the looks of it - candles already have incorrect time component.. This is issue 2
So, as I mentioned, you can skip issue 2 if issue 1 is the one that needs fixing. In either way - you can use the data that I have provided and the sample code to verify either of those 2 issues.
using VS 2019, Current version of trady (3.2.9?, i.e. master branch), .Net core 3.1
Current version of trady (3.2.9?) does not do the
minutetohourtransformation.First of all - following part of code in
IOhlcvDataExtensionwas changed previously:The code with the old
periodEndTimesomehow works better :) After transformation you actually get smaller amount of candles. WithindexTimeyou get the same exactly amount of candles as you had before the transformation. This is issue 1.So, the problem I am describing next - is actually using the old version of code (with
periodStartTime = periodEndTime). You can skip it, if issue 1 is not an issue but a feature?:data.txt
p.s. In order for deserialization to work - you have to have argument-less Candle constructor.
The data is that I passing to transformation is in time frame: 8:40 - 10:02, total of 83 records.
Expected result - 3 candles:
Actual result - 4 candles, wrong time components:
I have not actually compared the amount of
Volume. But from the looks of it - candles already have incorrecttime component.. This is issue 2So, as I mentioned, you can skip
issue 2ifissue 1is the one that needs fixing. In either way - you can use the data that I have provided and the sample code to verify either of those 2 issues.using VS 2019, Current version of trady (3.2.9?, i.e. master branch), .Net core 3.1