close positions at Friday close

Forums ProRealTime English forum ProOrder support close positions at Friday close

Viewing 3 posts - 1 through 3 (of 3 total)
  • #202470

    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 !

     

     

     

    #202472
    JS

    Hi @LoveTheCode!

    Use: c1 = CurrentDayOfWeek = 5

     

    #202490

    thanks JS, works nicely

    1 user thanked author for this post.
    avatar JS
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login