Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Ticks of different duration in same TimeSeries #180

Closed
martinklepsch opened this issue Aug 25, 2017 · 13 comments
Closed

Ticks of different duration in same TimeSeries #180

martinklepsch opened this issue Aug 25, 2017 · 13 comments

Comments

@martinklepsch
Copy link
Contributor

I just noticed that you can add ticks of different durations to a TimeSeries. I wonder if there should be an assertion that this isn't done? (Similar to adding Ticks that are before the endTime of the TimeSeries.)

Or maybe there are practical use cases for when you want to add a minute Tick to a hourly TimeSeries or similar?

@nimo23
Copy link
Contributor

nimo23 commented Aug 27, 2017

There are (edge) cases where data providers could give you a (for example) "1-min-timeseries" with leaks . For example, if a timeseries consists of 200 ticks, getting from a data-provider where each tick should represent 1-min, then there are cases for leaks (e.g. the first tick has a duration of 4 min for any reason, and the rest of the ticks have a right duration of 15-min). Unfortunatley, ta4j calculates "series.getTimePeriod()" with the first tick (by "computeTimePeriod"). So it can give you a wrong "PT4M" instead of "PT1M". However, it would be bad to do a assertion, because then the whole timeseries could not be uses only because of a few "leaks".

@martinklepsch
Copy link
Contributor Author

@nimo23 hey, good points but isn't it job of the end user to provide clean data? Is there any utility in putting leaks into the timeseries?

@nimo23
Copy link
Contributor

nimo23 commented Aug 27, 2017

The end user cannot guarantee that all ticks coming from 3 party fullfills the requirement of ta4j. Leaks can occur and ta4j should not stop to work if only one tick or so of 200 is in a other period..Putting assertion in timeseries limits the flexibility..

@nimo23
Copy link
Contributor

nimo23 commented Aug 27, 2017

What ta4j can provide is to make these "leaks" visible by a new method for example,

public Map<Period, List<Tick>> checkTicks(TimeSeries s)

which returns all Ticks with another period and then the end user can then make the decision what to do with the whole timeseries..

@martinklepsch
Copy link
Contributor Author

martinklepsch commented Aug 27, 2017

The end user cannot guarantee that all ticks coming from 3 party fullfills the requirement of ta4j. Leaks can occur and ta4j should not stop to work if only one tick or so of 200 is in a other period..Putting assertion in timeseries limits the flexibility..

If I have a tick that is four days instead of one that will also have about 4 times the value of other ticks. This can break strategies, cause false signals etc. IMO a library like this should be on the safe side rather than being on the flexible side.

@ElMoe
Copy link
Contributor

ElMoe commented Aug 27, 2017 via email

@martinklepsch
Copy link
Contributor Author

@ElMoe Instead of calculating the dominant tick-size I think the better/simpler approach might be to allow setting a field on the TimeSeries object that contains a duration against which all ticks are validated.

@nimo23
Copy link
Contributor

nimo23 commented Aug 27, 2017

If validate, then let the end user decide by using a property. There are cases where timeseries has such leaks and "it should not stop the system" only because of one tick of 200 fails while running each tick.

@mdeverdelhan
Copy link
Owner

Instead of calculating the dominant tick-size I think the better/simpler approach might be to allow setting a field on the TimeSeries object that contains a duration against which all ticks are validated.

@martinklepsch OK for that. But with just a warning log message. I don't want to add a property or blocking the system just for that.

By the way, from my experience, time management is always painful. So the less we accept to manage it the better it is.

@TheCookieLab
Copy link
Contributor

Perhaps I'm missing something, but if the data provider explicitly denotes tick-size (in addition to OHLC + V) and it has potential to be wrong, why not just check for it before instantiating a ta4j Tick?

@ElMoe
Copy link
Contributor

ElMoe commented Sep 9, 2017 via email

@dpalic
Copy link

dpalic commented Sep 15, 2017

I am not sure how to go on with this discussion.
This repository was dropped See #192
If this issue is still in clearance, could you please do me a favour and repost your question there? https://github.com/ta4j/ta4j
After reposting, could you close this issue here?

@mdeverdelhan
Copy link
Owner

To be continued on the new repo: https://github.com/ta4j/ta4j/issues

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants