Timeframes reference
The 3 functions and 9 values of tf: signature, effects, phase, cost and tested examples.
Convert timeframe texts and detect the start of a new period of a timeframe.
Functions#
tf.changed#
tf.changed([tf])
True on the first bar of each new period of the timeframe tf.
- Effects: keeps a state for each place it is written (a call site) and advances it when execution reaches the call.
- Phase: every bar.
- Cost: one state per call site.
- Examples: Bars in a day, A timeframe text the chart does not know.
tf.from_seconds#
tf.from_seconds([seconds])
The timeframe text of a length in seconds.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Examples: Bars in a day, A timeframe text the chart does not know.
tf.to_seconds#
tf.to_seconds([tf])
The length of a timeframe in seconds.
- Effects: none: the result depends on the arguments only.
- Phase: every bar.
- Cost: a fixed number of operations.
- Examples: Bars in a day, A timeframe text the chart does not know.
Values#
tf.id— The timeframe of the chart as text.tf.is_daily— True when the chart is daily.tf.is_daily_or_longertf.is_intraday— True when the chart is made of intraday bars.tf.is_minutestf.is_monthlytf.is_secondstf.is_weeklytf.multiplier