주시
1
0
포크
이미 MQLArticles을(를) 포크했습니다
0
원본 프로젝트 nique_372/MQLArticles
MQLArticles/IndicatorsCts/DEFINES.md
25 라인
1.7 KiB
Markdown
Nique_372
2026-11-01 15:00:25 -05:00
[← IndicatorsCts](./README.md)
# IndicatorsCts - Defines
Preprocessor defines that change the behavior of `IndicatorsCts` (indicator wrappers and the `CIndicatorCache` pool).
**How to use them:** define them in your EA **before** the first `#include` of the library, the preprocessor evaluates them when the file is included.
```mql5
#define INDICATOR_CACHE_DBL_DIG (4)
#include "..\\IndicatorsCts\\Imp\\Code\\Pool.mqh"
```
In the source code a disabled switch appears as `//#define NAME`. The ones marked **overridable** are wrapped in `#ifndef NAME`, so your value wins.
## Extra logs
| Define | Default | File | Effect |
|---|---|---|---|
| `MQLARTICLEs_INDSIMPLE_MAIN_LOG_DESC` | off | `Base\Def.mqh` (used in `Base\Base.mqh`, `Base\WBuf.mqh`) | Info logs of `CiIndicatorSimple` when an indicator is created (type, handle, number of buffers) and when it is released. Note the lowercase `s` in the name |
## Pool (`Imp\Code\PoolDef.mqh`)
| Define | Default | Effect |
|---|---|---|
| `INDICATOR_CACHE_DBL_DIG` | `(2)` | Decimals used to round a `double` parameter (`NormalizeDouble`) before writing it into the key of the pool. Two indicators whose `double` parameters are equal up to these decimals share the same instance. **Overridable** |
| `MQLA_INDPOOL_CRESERVE2(arr, data, s, r)` | grows `arr` and `data` together | The "allocator" of the generated pool: when `s >= r` it increases the reserve `r` and resizes both the pointers array (`arr`) and the data array (`data`). Define it with the same signature to use your own growth policy. **Overridable** |
> `Imp\Code\Main.mqh` and `Imp\Code\Pool.mqh` are generated (`Imp\Internal\App.py`, configured with `Imp\Code\Config\*.json`); do not edit them by hand.