Helmuth
Helmuth

Reputation: 21

Stop Loss time-out

I trigger the stop loss time-out with strategy.exit("ExitL", "Long", stop = SL)

How can I allow the price to go below the stop loss limit for a certain period of time? e.g. for 1 minute?

Only if the price stays below the stop loss limit for more than 1 minute the stop loss should come into force.

THANKS

Upvotes: 0

Views: 328

Answers (1)

PineCoders-LucF
PineCoders-LucF

Reputation: 8789

That's currently not possible in Pine, neither through strategy.*() parameters nor through managing your trade manually in Pine. Every time the script is executed in the realtime bar, variables are reinitialized as if the script was running for the first time on a new bar, so while you can detect events such as a stop breach, there is no way to save the time when it occurred in order to follow the duration through the next script's iterations in the realtime bar. PineCoders has a suggestion to add the possibility to time events in the realtime bar here: https://trello.com/c/ulHOgJIl

Upvotes: 0

Related Questions