# 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.

{% code overflow="wrap" %}

```
[DAILY_MAX(requested_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**Parameters**

* `requested_data` - Data point to evaluate for the maximum value. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

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

{% endcode %}

This example returns the highest adjusted price from the previous 10 trading days.
{% endtab %}

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_MAX(volume_adj, 1, 20)]
```

{% endcode %}

This example returns the highest adjusted volume from the next 20 trading days.
{% endtab %}
{% endtabs %}

***

### DAILY\_MIN

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

{% code overflow="wrap" %}

```
[DAILY_MIN(requested_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**Parameters**

* `requested_data` - Data point to evaluate for the minimum value. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

```
[DAILY_MIN(price_low_adj, -10, -1)]
```

{% endcode %}

This example returns the lowest adjusted price from the previous 10 trading days.
{% endtab %}

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_MIN(volume_adj, 1, 20)]
```

{% endcode %}

This example returns the lowest adjusted volume from the next 20 trading days.
{% endtab %}
{% endtabs %}

***

### DAILY\_AVG

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

{% code overflow="wrap" %}

```
[DAILY_AVG(requested_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**Parameters**

* `requested_data` - Data point to average. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

```
[DAILY_AVG(volume_adj, -20, -1)]
```

{% endcode %}

This example returns the average adjusted daily volume for the previous 20 trading days.
{% endtab %}

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_AVG(dollar_volume, 1, 5)]
```

{% endcode %}

This example returns the average dollar volume for the next 5 trading days.
{% endtab %}
{% endtabs %}

***

### DAILY\_SUM

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

{% code overflow="wrap" %}

```
[DAILY_SUM(requested_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**Parameters**

* `requested_data` - Data point to sum. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

```
[DAILY_SUM(dollar_volume, -5, -1)]
```

{% endcode %}

This example returns the total dollar volume for the previous 5 trading days.
{% endtab %}

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_SUM(volume_unadj, 1, 5)]
```

{% endcode %}

This example returns the total unadjusted volume for the next 5 trading days.
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX(requested_data, max_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `max_data` - Data point to evaluate for the maximum value. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX(volume_adj, price_high_adj, -10, -1)]
```

{% endcode %}

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

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX(percent_change, volume_adj, -20, -1)]
```

{% endcode %}

This example finds the date with the highest volume from the previous 20 trading days and returns the change percentage for that date.
{% endtab %}

{% tab title="Example 3" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX(date, percent_range, 1, 252)]
```

{% endcode %}

This example returns the date with the largest daily trading range from the next 252 trading days (about one year).
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN(requested_data, min_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `min_data` - Data point to evaluate for the minimum value. Accepts any available [daily data point](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example 1" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN(percent_change, volume_adj, -10, -1)]
```

{% endcode %}

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

{% tab title="Example 2" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN(time_high, percent_change, -252, -1)]
```

{% endcode %}

This example finds the date with the lowest change percentage from the previous 252 trading days (about one year), then returns the time of the highest price for that date.
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_BEFORE_MAX(requested_data, min_data, max_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_BEFORE_MAX(relative_volume, price_low_adj, price_high_adj, -252, -1)]
```

{% endcode %}

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.
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_AFTER_MAX(requested_data, min_data, max_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_AFTER_MAX(price_low_adj, price_low_adj, price_high_adj, -252, -1)]
```

{% endcode %}

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.

{% hint style="warning" %}
`price_low_adj` is passed twice because it serves as both the data point used to find the minimum and the data point to return.
{% endhint %}
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_BEFORE_MIN(requested_data, max_data, min_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_BEFORE_MIN(date, price_high_adj, price_low_adj, -252, -1)]
```

{% endcode %}

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.
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_AFTER_MIN(requested_data, max_data, min_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_AFTER_MIN(volume_adj, price_high_adj, price_low_adj, -252, -1)]
```

{% endcode %}

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.
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_BEFORE_MAX(requested_data, target_max_data, max_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_BEFORE_MAX(volume_adj, volume_adj, price_high_adj, -10, -1)]
```

{% endcode %}

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

{% hint style="warning" %}
`volume_adj` is passed twice because it serves as both the data point used to find the maximum and the data point to return.
{% endhint %}
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MAX_AFTER_MAX(requested_data, target_max_data, max_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}

```
[DAILY_VALUE_AT_MAX_AFTER_MAX(volume_adj, volume_adj, price_high_adj, -10, -1)]
```

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

{% hint style="warning" %}
`volume_adj` is passed twice because it serves as both the data point used to find the maximum and the data point to return.
{% endhint %}
{% endtab %}
{% endtabs %}

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_BEFORE_MIN(requested_data, target_min_data, min_data, start_offset_days, end_offset_days)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_BEFORE_MIN(date, volume_adj, price_low_adj, -10, -1)]
```

{% endcode %}

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

***

### 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.

{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_AFTER_MIN(volume_adj, volume_adj, price_low_adj, -10, -1)]
```

{% endcode %}

**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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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](https://help.edgetracker.com/advanced-scanner/data-point-reference/daily-data-points#data-points).
* `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`.

{% tabs %}
{% tab title="Example" %}
{% code overflow="wrap" %}

```
[DAILY_VALUE_AT_MIN_AFTER_MIN(percent_change, volume_adj, price_low_adj, -10, -1)]
```

{% endcode %}

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.
{% endtab %}
{% endtabs %}
