strategy.close_all

Closes the whole position with a market order at the next bar open.

strategy.close_all(comment: string = na)

Parameters

Example

if hour(time_close, "America/New_York") == 16
    strategy.close_all("Session end")