close all positions at a defined time

 

Hello, I want to close all positions at a defined time. E.g. at 23.00 I want to close all positions. 

What code you recommend.

Reason: