-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minute to hour transformation: failure #111
Comments
After some digging through the code I see at least 1 issue that could lead to above problems. In
The date that is a start date is in format: {12/2/2017 8:40:00 PM +00:00} EDIT: it seems like that after getting the
but it did not resolve the problem completely, though I have to admit - after transformation number of candles decreased from 83 to just 3 - using the new code ( New actual result
So, something is still not completely right :) Also I just found this:
so alternative solution (and a better one) would be to use |
Alright, a question:
With that idea in mind - I have applied some fixes to the code:
and
and
This, plus the fix applied in previous response:
New actual result:
sorry for spam. I could have made it a pull request as well. Just interested in your opinion on this topic before any commits.. EDIT: Also, using ElementAt without proper optimizations is many times slower than accessing element by index. If you could change this aspect of Trady - you could increase it's performance tenfold. I had to fix following method:
In my case I have 1_232_239 minute ticks. Waited for 1 minute for the transformation to finish on 8700k 4 core CPU... After the fix it takes a second at most. I have not inspected the code, but I suppose that this is not the only place where you are using this approach.. |
Tested all, seems to work well nice job. Will probably need a thorough test but also fixes my issue you tagged above. Your solution is much nicer than the one I hacked together meanwhile haha |
Current version of trady (3.2.9?) does not do the
minute
tohour
transformation.First of all - following part of code in
IOhlcvDataExtension
was changed previously:The code with the old
periodEndTime
somehow works better :) After transformation you actually get smaller amount of candles. WithindexTime
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?: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 2
ifissue 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
The text was updated successfully, but these errors were encountered: