strategy

Declares the script as a strategy (a backtest): the first statement instead of indicator(). strategy.* orders given on a bar fill from the next bar on the simulated account (market at the open, stops and limits when the bar reaches them).

strategy(title: const string, shorttitle: const string = na, overlay: const bool = false, precision: const int = na, max_lines_count: const int = 50, max_boxes_count: const int = 50, max_labels_count: const int = 50, initial_capital: const float = 1000000, default_qty_type: const string = "fixed", default_qty_value: const float = 1, pyramiding: const int = 0, commission_type: const string = "cash_per_contract", commission_value: const float = 0, slippage: const int = 0, process_orders_on_close: const bool = false, fill_model: const string = "touch", format: const string = na, scale: const string = na, explicit_plot_zorder: const bool = false, behind_chart: const bool = false, calc_bars_count: const int = na, max_polylines_count: const int = na, dynamic_requests: const bool = false, calc_on_every_tick: const bool = false, calc_on_order_fills: const bool = false, close_entries_rule: const string = na, margin_long: const float = na, margin_short: const float = na, risk_free_rate: const float = na, use_bar_magnifier: const bool = false, backtest_fill_limits_assumption: const int = na, currency: const string = na, calc_on_every_history_tick: const bool = false)

Parameters

Example

strategy("MA cross", overlay=true, commission_value=2.5, slippage=1)