Exit before market close
Author: lepete
Creation Date: 4/5/2018 2:41 PM
profile picture

lepete

#1
Need to exit long positions before market close, say, at 1555. There is a previous post which mentions the GetTime function, but that seems to be deprecated. Thus, how can one SellAtMarket at a given time?
profile picture

Eugene

#2
profile picture

lepete

#3
Thanks Eugene,

I was able to implement the following, where my [i] is the bar:

CODE:
Please log in to see this code.


then, only buy if timenow < 1555. It works fine.

profile picture

Eugene

#4
Or if Community Components is installed you can literally use this one-liner:
CODE:
Please log in to see this code.

Yes, even "using Community Components" isn't required.
profile picture

lepete

#5
thx - got it!
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).