# Draw your first indicator

> **What you need.** Editing needs a screen at least 768 wide.

## 1. Open the file

Press **Open in the editor** on the code below.

```python
import forge as fg
from forge import param, ta

FORGE_API = 1


class RsiBands(fg.Indicator):
    name = "RSI bands"
    short_name = "RSIB"
    pane = "new"
    precision = 2
    format = "number"

    period = param.Int(14, min=2, max=200)
    source = param.Source("close")

    rsi = fg.Output.line("RSI")
    hot = fg.Output.state("Overbought")
    levels = [fg.Level(70, "Overbought"), fg.Level(30, "Oversold")]
    warmup = lambda self: self.period

    def calculate(self, bars, start) -> None:
        r = ta.rsi(bars[self.source], self.period)
        self.out.rsi[start:] = r[start:]
        self.out.hot[start:] = r[start:] > 70
```

`FORGE_API = 1` is required. A file without it is refused. A file holds exactly one `fg.Indicator` class, and `pane = "new"` draws it in its own pane under the price.

## 2. Read what it declares

Settings are class attributes made with `param`. `param.Int(14, min=2, max=200)` is a whole number that defaults to 14 and cannot leave 2 to 200. `param.Source("close")` picks which price the indicator reads.

An output is declared once and filled in `calculate`. `fg.Output.line("RSI")` holds one float for each bar, and `fg.Output.state("Overbought")` holds true or false for each bar. `levels` draws the two lines at 70 and 30.

> **Trap.** An indicator cannot place orders. Calling any order, account or context function in an indicator file is refused when the file loads.

> **Check.** The first 14 values of the RSI output are NaN, and the line starts on bar 15.

## 3. Change it

Change the period from 14 to 7 and the levels to 80 and 20. Press **Format** to tidy the file.

> **You now have**
>
> A file that draws an RSI with two levels and an overbought state, and a settings form that came with it.
>
> [Next: Write your first strategy](https://oathra.dev/docs/get-started/get-a-verdict)
