Examples

Forge API 1

Templates

Minimal indicator

Indicator

An indicator with one setting and one output.

Open in the editorSee the code

Indicator with several outputs

Indicator

An indicator with a line, a histogram, a state, an event, a hidden output, levels and a second timeframe.

Open in the editorSee the code

Minimal strategy

Strategy

A strategy with one setting and a compute method.

Open in the editorSee the code

Strategy with every hook

Strategy

A strategy that defines every optional hook, each with a one-line body.

Open in the editorSee the code

Cookbook

ATR stop and target

Strategy

A strategy whose stop is a multiple of the average true range and whose target is a multiple of the risk.

Open in the editorSee the code

London session entries

Strategy

A strategy that takes entries only between 07:00 and 17:00 London time.

Open in the editorSee the code

RSI crossing a level

Strategy

A strategy that enters when the RSI crosses up through a setting and leaves when it reaches another.

Open in the editorSee the code

RSI reversion

Strategy

A strategy that buys when the RSI falls under a level, leaves when it recovers, and sets its stop and target from the market's range.

Open in the editorSee the code