Skip to main content
A strategy declares itself with strategy(...) instead of indicator(...) and places orders with the strategy.* functions. The orders are simulated: a built-in broker emulator fills them against the chart’s bars on a simulated account. Nothing is sent to a real broker.
GoCharting is a charting and analytics tool. This is not investment advice. Trading and investing carry a high risk of loss and are not suitable for everyone. You can lose some or all of your money.
The script runs once per bar; order calls may sit in if, loops and functions. See Orders and positions for fills and Reading a strategy’s results for the account variables. In an indicator() script the order calls and strategy.* variables compile but do nothing.

The declaration

strategy(title, ...) is called once at the top level; only title is required and every argument is const. The display arguments (shorttitle, overlay, format, precision, scale, max_*_count, behind_chart) are those of indicator(). The account arguments: These values are not checked (pyramiding=0 compiles). There is no slippage, margin or currency argument.