-1

Is it possible to fill an order below/above the low/high of the bar (not below/above the close)? With process_orders_on_close = true - the order is filled on close of the bar and with process_orders_on_close = false - on the next bar but I need an order to be filled n per cent below or above the low/high of the specific bar. Would be grateful for a solution. enter image description here Here an example:

Bjorn Mistiaen
  • 6,459
  • 3
  • 18
  • 42
admiral
  • 1
  • 2

1 Answers1

0

There is only OHLC values available for backtesting, so you can do it only for realtime ticking bars (where price changing information is available) by using calc_on_every_tick parameter set to true.

strategy(title="My example strategy", calc_on_every_tick=true)

https://kodify.net/tradingview/strategy-settings/calculate-every-tick/

https://www.tradingview.com/pine-script-docs/en/v4/essential/Strategies.html#backtesting-and-forwardtesting

Starr Lucky
  • 1,578
  • 1
  • 7
  • 8