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.
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.