hi, could someone please help with how to close open position at the end of the week (i.e. market close on Friday??? )
I have been trying the below but not working:
// Conditions to exit long positions
c1 = OpenDayOfWeek = 5
c2 = CurrentTime = 163000
IF c1 AND c2 THEN
SELL AT MARKET
ENDIF
It might also be possible with defparameters flatafter but that is only in format HHMMSS so doesn’t seem to allow for the day of the week
Thanks in advance for any help !