Skip to contents

Converts a KuCoin klines frequency string into its equivalent duration in seconds.

Usage

frequency_to_seconds(freq)

Arguments

freq

Character string representing the frequency (e.g., "1min", "1hour"). Allowed values: "1min", "3min", "5min", "15min", "30min", "1hour", "2hour", "4hour", "6hour", "8hour", "12hour", "1day", "1week", "1month".

Value

Numeric value representing the duration in seconds.

Details

Workflow Overview

  1. Validation: Calls check_allowed_frequency_str() to ensure freq is valid.

  2. Conversion: Retrieves the corresponding duration in seconds from freq_to_second_map.

API Endpoint

Not applicable (helper conversion function).

Usage

Utilised to translate frequency strings into seconds for time range calculations in klines data retrieval.

Official Documentation

Not directly tied to a specific endpoint; see KuCoin klines API documentation for frequency mappings.

Examples

if (FALSE) { # \dontrun{
frequency_to_seconds("1min")   # Returns 60
frequency_to_seconds("1hour")  # Returns 3600
} # }