Daily Calculation Functions

Daily Calculation Functions allow you to aggregate or extract specific daily data points over a defined date range. These functions make it possible to calculate maximums, minimums, averages, and sums, or to retrieve a value from the exact date another data point reaches a specified extreme. By combining offsets, ranges, and targeted data points, you can perform precise historical analysis and build advanced formulas tailored to your scanning needs.

DAILY_MAX

Returns the maximum value of a requested data point within a specified date range.

[DAILY_MAX(requested_data, start_offset_days, end_offset_days)]

Parameters

  • requested_data - Data point to evaluate for the maximum value. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

[DAILY_MAX(price_high_adj, -10, -1)]

This example returns the highest adjusted price from the previous 10 trading days.


DAILY_MIN

Returns the minimum value of a requested data point within a specified date range.

[DAILY_MIN(requested_data, start_offset_days, end_offset_days)]

Parameters

  • requested_data - Data point to evaluate for the minimum value. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example returns the lowest adjusted price from the previous 10 trading days.


DAILY_AVG

Returns the average of a requested data point within a specified date range.

Parameters

  • requested_data - Data point to average. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example returns the average adjusted daily volume for the previous 20 trading days.


DAILY_SUM

Returns the total of a requested data point within a specified date range.

Parameters

  • requested_data - Data point to sum. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example returns the total dollar volume for the previous 5 trading days.


DAILY_VALUE_AT_MAX

Returns the value of a requested data point for the date another data point reaches its maximum within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when max_data reaches its maximum. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the date with the highest price from the previous 10 trading days and returns the adjusted total volume for that date.


DAILY_VALUE_AT_MIN

Returns the value of a requested data point for the date another data point reaches its minimum within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when min_data reaches its minimum. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the date with the lowest total volume from the previous 10 trading days, then returns the change percentage for that date.


DAILY_VALUE_AT_MIN_BEFORE_MAX

Returns the value of a requested data point for the date another data point reaches its minimum before a third data point reaches its maximum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when min_data reaches its minimum before max_data reaches its maximum. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the lowest value of this data point before the maximum value of max_data. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the date this value is highest, and then looks for the minimum of min_data on dates prior to that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the highest price from the previous 252 trading days (about one year), then finds the lowest price that occurred before that high, and returns the relative volume for that date.

This allows you to analyze the relative volume on the day securities reach a low before beginning an upward move.


DAILY_VALUE_AT_MIN_AFTER_MAX

Returns the value of a requested data point for the date another data point reaches its minimum after a third data point reaches its maximum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when min_data reaches its minimum after max_data reaches its maximum. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the lowest value of this data point after the maximum value of max_data. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the date this value is highest, and then looks for the minimum of min_data on dates after that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the highest price from the previous 252 trading days (about one year), then returns the lowest price that occurred after that high.

Put simply, this identifies the lowest price after a security's 52-week high.


DAILY_VALUE_AT_MAX_BEFORE_MIN

Returns the value of a requested data point for the date another data point reaches its maximum before a third data point reaches its minimum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when max_data reaches its maximum before min_data reaches its minimum. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the highest value of this data point before the minimum value of min_data. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the date this value is lowest, and then looks for the maximum of max_data on dates before that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the lowest price from the previous 252 trading days (about one year), then returns the date when the highest price occurred before that low.


DAILY_VALUE_AT_MAX_AFTER_MIN

Returns the value of a requested data point for the date another data point reaches its maximum after a third data point reaches its minimum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when max_data reaches its maximum after min_data reaches its minimum. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the highest value of this data point after the minimum value of min_data. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the date this value is lowest, and then looks for the maximum of max_data on dates after that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the lowest price from the previous 252 trading days (about one year), then finds the highest price that occurred after that low, and returns the adjusted volume for that date.


DAILY_VALUE_AT_MAX_BEFORE_MAX

Returns the value of a requested data point for the date another data point reaches its maximum before a third data point reaches its own maximum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when target_max_data reaches its maximum before max_data reaches its maximum. Accepts any available daily data point.

  • target_max_data - Data point to evaluate for the maximum value. The function finds the highest value of this data point before the maximum value of max_data. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the date this value is highest, and then looks for the maximum of target_max_data on dates before that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the highest price from the previous 10 trading days, then returns the highest adjusted volume that occurred before that high.


DAILY_VALUE_AT_MAX_AFTER_MAX

Returns the value of a requested data point for the date another data point reaches its maximum after a third data point reaches its own maximum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when target_max_data reaches its maximum after max_data reaches its maximum. Accepts any available daily data point.

  • target_max_data - Data point to evaluate for the maximum value. The function finds the highest value of this data point after the maximum value of max_data. Accepts any available daily data point.

  • max_data - Data point to evaluate for the maximum value. The function finds the date this value is highest, and then looks for the maximum of target_max_data on dates after that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the highest price from the previous 10 trading days, then returns the highest adjusted volume that occurred after that high.


DAILY_VALUE_AT_MIN_BEFORE_MIN

Returns the value of a requested data point for the date another data point reaches its minimum before a third data point reaches its own minimum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when target_min_data reaches its minimum before min_data reaches its minimum. Accepts any available daily data point.

  • target_min_data - Data point to evaluate for the minimum value. The function finds the lowest value of this data point before the minimum value of min_data. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the date this value is lowest, and then looks for the minimum of target_min_data on dates before that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the lowest price from the previous 10 trading days, then returns the date with the lowest volume before that low.


DAILY_VALUE_AT_MIN_AFTER_MIN

Returns the value of a requested data point for the date another data point reaches its minimum after a third data point reaches its own minimum, within a specified date range.

Parameters

  • requested_data - Data point to return. This value is retrieved for the date when target_min_data reaches its minimum after min_data reaches its minimum. Accepts any available daily data point.

  • target_min_data - Data point to evaluate for the minimum value. The function finds the lowest value of this data point after the minimum value of min_data. Accepts any available daily data point.

  • min_data - Data point to evaluate for the minimum value. The function finds the date this value is lowest, and then looks for the minimum of target_min_data on dates after that. Accepts any available daily data point.

  • start_offset_days - Start of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

  • end_offset_days - End of the date range to evaluate, specified as trading days relative to the scan date. Must be a whole number between -2,520 and 2,520.

This example finds the lowest price from the previous 10 trading days, then finds the lowest volume that occurred after that low, and returns the change percentage for that date.

Last updated

Was this helpful?