How to close all open position at a certain time

 

Hi,

i'm new to this forum. I'd like to set up a simple script that takes all the open positions on my account at a certain time (let's say 7 a.m.) and close oll of them at the BID price ?

Thanks,

Luca

 

what about the following (got something from the book section) ?

for (int i=1; i<=OrdersTotal(); i++)
{
OrderClose (i, i.lots, BID, 2)
}

questions ?

how do i condition this to a time ? is there any time function ?

is correct to get the lots on the order saying i.lots ?

Thanks.

Reason: