Close all positions at a certain time

Created at 31 May 2015, 20:18
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
Money_is_an_Illusion's avatar

Money_is_an_Illusion

Joined 31.05.2015

Close all positions at a certain time
31 May 2015, 20:18


Hi,

 

 I'm creating my first cBot, and everything works fine, execpt that I would like to close automatically all my positions at a certain time, let's says 22H56 for exemple.

I played around with Server.Time etc but noone works in my backtest. trades remains opened for days until stop losses/tp.

Coudl you help me please ?


@Money_is_an_Illusion
Replies

Spotware
11 Jun 2015, 17:49

Dear Trader,

You can use the Timer object in your Code. An example of using the Time object is given at the references of API Section: /api/reference/internals/algo/ontimer-2995


@Spotware