OHLCHelper.get_time_rounded

You're seeing just the function get_time_rounded, go back to OHLCHelper module for more information.
Link to this function

get_time_rounded(timestamp, timeframe, opts \\ [])

Specs

get_time_rounded(number(), OHLC.timeframe(), list() | nil) ::
  number() | DateTime

Gets the rounded timestamp based on the timeframe.

Parameters:

  • timestamp - Unix timestamp which will be rounded.
  • timeframe - Timeframe used for rounding the timestamp. Available values are: :minute, :hour, :day, :week
  • opts - Options for rounding the timestamp. Available values are:
    • {:format, :stamp | :struct} - Returned value will be unix timestamp or DateTime struct.
    • {:type, :down | :up | :jump} - Timestamp will be rounded up, down or jump to the next time cycle. Default is :up.