i'm trying to setup a funcion to close the operation at 17.25 (5 minutes before end in European time) using the following code:
Code: Select all
If time >=SessEnd and Marketposition<0 Then
BuytoCover ("STime") currentshares shares this bar on close;
If time >=SessEnd and Marketposition>0 Then
Sell ("LTime") currentshares shares this bar on close;
i have tried with currenttime to use the computer time, but if you use in chart after the close will generate close of all open trade at second bar..
Have you any suggestion?