How can I know when the broker will close the trade in friday?

 

I've just been having a look at this too, with the idea of closing out my trades five minutes before the session closes. (if anybody's got any examples of that I'd be interested to take a look).

Have a look at function SymbolInfoSessionTrade.You can use it to get the end of session time on Friday, which I'm assuming is what you are looking for? So you can close out your trade before then? You might also need TimeTradeServer to get the current server time. Not sure how all this works but maybe this will give you a starting point.

;-) Ian

 
mogplus8:

I've just been having a look at this too, with the idea of closing out my trades five minutes before the session closes. (if anybody's got any examples of that I'd be interested to take a look).

Have a look at function SymbolInfoSessionTrade.You can use it to get the end of session time on Friday, which I'm assuming is what you are looking for? So you can close out your trade before then? You might also need TimeTradeServer to get the current server time. Not sure how all this works but maybe this will give you a starting point.

;-) Ian

I try use it, but the from and to value are all is  "1970..." I donot know what is it.
 
codeidea:
I try use it, but the from and to value are all is  "1970..." I donot know what is it.

Why? Did you read documentation?

time in seconds from 00 hours 00 minutes, in the returned value date should be ignored


Reason: