# Indicators Module

Compose indicators from strategies via use_indicator() and the indicators.* namespace.

<a id="indicators"></a>
## indicators

```python
indicators.name(**params)
```

Call any indicator from your indicators/ folder inside a strategy.

The `indicators` namespace lets you call any indicator you have created in your `indicators/` folder. Access them by name using `indicators.name()`, passing any parameters as keyword arguments. The indicator is automatically plotted on the chart and the computed Series is returned for use in signal logic.

### Parameters

- `name` (`str`, default `required`): The indicator filename (without .py). For example, indicators/sma.py becomes indicators.sma()
- `**params` (`any`, default `indicator defaults`): Override any input parameters defined in the indicator

### Returns

pandas Series with the indicator values

### Example

```python
@strategy(name="MA Crossover", overlay=True)
class MACrossover:
    fast = input.int(10, "Fast Period")
    slow = input.int(20, "Slow Period")

    def calculate(self, df):
        fast_ma = indicators.sma(period=self.fast, color="#26A69A")
        slow_ma = indicators.sma(period=self.slow, color="#EF5350")

        return {
            'entry_long': cross_above(fast_ma, slow_ma),
            'exit_long': cross_below(fast_ma, slow_ma),
        }
```

### Notes

- Indicators are discovered from your workspace indicators/ folder.
- Any @indicator-decorated script becomes callable through this namespace.
- Results are cached per (name, params) combination for performance.

<a id="use_indicator"></a>
## use_indicator

```python
use_indicator(name, **params)
```

Alternative function syntax for calling indicators by name.

Loads and executes an indicator from your `indicators/` folder by name. Functionally equivalent to `indicators.name()` but uses a function call instead of attribute access. Useful when the indicator name is stored in a variable.

### Parameters

- `name` (`str`, default `required`): Indicator filename without .py
- `**params` (`any`, default `indicator defaults`): Override any input parameters

### Returns

pandas Series with the indicator values

### Example

```python
from quant_charts import use_indicator

sma = use_indicator('sma', period=20)
rsi = use_indicator('rsi', period=14)
```

### Notes

- Equivalent to the `indicators.name()` namespace syntax.
