---
id: faq_item.1315
page_type: faq_article
title: "What is the methodology used to calculate and limit the EMA intervals?"
description: "Calculation methods and limitations: Because it is impossible to keep all possible combinations in memory, the Moonbot terminal calculates the prices as follows..."
section: faq
category: "Strategy settings"
url: https://moonbot.pro/faq/strategy-settings/1315?format=md
locale: en
alternate_ru: https://moonbot.pro/ru/faq/strategy-settings/1315?format=md
alternate_zh: https://moonbot.pro/zh/faq/strategy-settings/1315?format=md
parent: https://moonbot.pro/faq/strategy-settings?format=md
previous: https://moonbot.pro/faq/strategy-settings/1314?format=md
next: https://moonbot.pro/faq/strategy-settings/1316?format=md
status: published
updated_at: 2026-11-15T16:12:40+03:00
---

# What is the methodology used to calculate and limit the EMA intervals?

Calculation methods and limitations:\
Because it is impossible to keep all possible combinations in memory, the Moonbot terminal calculates the prices as follows: \
1\) A set of per second averages from the current price(1 sec) to 300 sec. age. Calculated as the classic EMA (Pnext = (Pprev \* N + Pcurr) / (N + 1)) \
2\) Minute averages from 2 to 90 minutes ago. Calculated simply as the average price per minute \
3\) Hourly averages from 1 to 41 hours ago (exchange limitations exist) (is calculated as the average price of the 5m candles) Thus, the X,Y parameters in the EMA formula may be: 1..300 or 2m..90m or 1h..41h\
4\) If Y is 1s the comparison will be made with the current price\
5\) Recalculation of hourly max/min is performed every 5 minutes, as a new 5m candlesticks appear. To avoid doubling of Max(1h)/Min(1h) and Max(60m)/Min(60m) records, the hourly ones are recalculated from 1 hour ago. For example, max(1h,1) is taken by 5 minute candlesticks from 60 to 120 minutes ago.\
6\) Recalculation of minute max/min is carried out every tick (1 tick = 2 sec), i.e. with a delay from 2 to 4 sec. At the same time, the last 60 seconds are not included in the calculation of the levels of minute max/min.\
Thus, a sharp increase at the last minute (for minute intervals) and during the last 60 minutes (for hourly intervals) is not considered in calculating max/min levels and, therefore, in a moment the max value can be more than zero and min less than zero. It is done in this way to be able to give create a higher-high/lower-low using the formula (i.e. to write a condition that the current price has become higher than the maximum or lower than the minimum over the last N minutes/hours).

## Navigation

Path: [Main](https://moonbot.pro/?format=md) / [FAQ](https://moonbot.pro/faq?format=md) / [Strategy settings](https://moonbot.pro/faq/strategy-settings?format=md) / What is the methodology used to calculate and limit the EMA intervals?

Parent section: [Strategy settings](https://moonbot.pro/faq/strategy-settings?format=md)

Previous: [What do the common values that are written in the parameter formula mean, for example, for EMA(X,Y)>A?](https://moonbot.pro/faq/strategy-settings/1314?format=md)

Next: [Can I visually see the calculated points of the EMA parameters on a chart?](https://moonbot.pro/faq/strategy-settings/1316?format=md)

## Related

- [Can I visually see the calculated points of the EMA parameters on a chart?](https://moonbot.pro/faq/strategy-settings/1316?format=md)
- [Is it possible to implement Trailing Buy functionality in the Moonbot terminal?](https://moonbot.pro/faq/strategy-settings/1317?format=md)
- [Can you give some examples of formulas that can be written in the CustomEMA parameter field of the Moonbot terminal strategy?](https://moonbot.pro/faq/strategy-settings/1318?format=md)
- [When should the Spread strategy be used?](https://moonbot.pro/faq/strategy-settings/1319?format=md)
- [What are the specific parameters of a Spread strategy?](https://moonbot.pro/faq/strategy-settings/1320?format=md)
