Skip to content

Customizable start time for sampling #141

@CITIZENDOT

Description

@CITIZENDOT

First of all, Thank you for such a great library ❤️. There are not a lot of packages which offer streaming calculations.

Coming to the issue, Start time of sampling is restricted to the semantic beginning of time units.

https://nardew.github.io/talipp/latest/reference/talipp/input/

Each timeframe is counted from different starting point. Seconds are counted since whole minutes, minutes are counted since whole hours, hours are counted since whole days and days are counted since the beginning of the year.

Why this is an issue? Let's take an example:

  • Market starts at 09:15 AM
  • A Sampler of MIN_4 is being used in an indicator.
  • In this case, It makes more sense to merge 09:15 AM and 09:19 AM into one period, because market started at 09:15 AM, and 09:19 is 4 minutes away from it.
  • But the sampler says, 09:15 AM comes into the period of 09:12 AM to 09:16 AM. (minutes are counted since whole hours), and does not merge 09:19 AM into first period.

I think, Sampler can have an optional starting point (datetime). If user did not set it, it can behave just as it's behaving now. But if user sets it, it'll use it instead.

So, Everyday, user can set it to market's opening time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions