The header and its settings
Markets, bar size, limits and trading hours.
strategy "Language Tour"markets: EURUSD, GBPUSDbars: 15mevaluate: bar_closemax_open: 3max_open_per_side: 2direction: bothopposite: reversepyramiding: 3min_distance: 20 pipsmax_daily_loss: 3%max_drawdown: 10%trade_only: within sessions london, new_yorkEvery setting, with its type and default:
| Setting | Type | Default | What it does |
|---|---|---|---|
market | symbol | chart symbol | Symbol the script runs on. |
markets | list<symbol> | Several symbols; alerts evaluate each independently. | |
bars | bartype | chart bars | Bar type: timeframe, range(n), xray(n), renko(n) or heikin_ashi(tf). |
evaluate | string | bar_close | bar_close (default, never repaints) or tick. |
pane | string | price | price, new or a named pane. |
max_open | int | 1 | Open trades allowed at once. |
max_open_per_side | int | Open trades allowed per side. | |
direction | string | both | both, long or short. |
opposite | string | ignore | On an opposite signal: close, reverse, ignore or hedge (where the venue supports it). |
warmup | int | Bars required before rules run (computed by the compiler when omitted). | |
repeat | string | once per bar | once, once per bar, once per bar close or every time. |
cooldown | duration | bars | Minimum time or bars between notifications. | |
expires | date | duration | When the alert stops. | |
check | duration | every 1m | How often account-only alerts are checked. |
show_on_chart | bool | true | Draw fire points, watched levels and live status on the chart. |
max_daily_loss | percent | money | Pause the deployment after this loss in a day. | |
max_drawdown | percent | money | Pause the deployment at this drawdown. | |
max_total_risk | percent | Risk allowed across open trades. | |
pyramiding | int | 1 | Entries allowed in the same direction. |
min_distance | distance | Smallest distance between pyramided entries. | |
trade_only | sessions | Sessions in which the strategy may open trades. |
Limits are checked when an entry fills, not when it is placed (E19). With trade_only, entries are only created inside the listed sessions, while exits and management carry on outside them (E22). The named sessions are sydney, tokyo, asia, frankfurt, london and new_york.