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{
      calendar: term(),
      day: term(),
      hour: term(),
      microsecond: term(),
      minute: term(),
      month: term(),
      second: term(),
      std_offset: term(),
      time_zone: term(),
      utc_offset: term(),
      year: term(),
      zone_abbr: term()
    }

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.