blindsquirrel
New member
The documentation on time and date functions in thinkscript is pretty thin.
What I need is to limit my strategies trades to Mon-Fri, 8:30 - 3:00 pm (future's market day session).
Looking at example scripts that use time, I attempted implementing some code:
But, it doesn't seem to be working.
Is there a way to get human readable time formatting from the GetTime() function?
Any help is appreciated.
What I need is to limit my strategies trades to Mon-Fri, 8:30 - 3:00 pm (future's market day session).
- No trades should open before 8:30.
- All positions should flatten at 5 min before 3:00.
Looking at example scripts that use time, I attempted implementing some code:
Python:
# Flatten is true if we're 5 min or less from end of futures trading
def startTime = 0830;;
def lastFiveMinuteBar = 1455;
def endOfTradingTime = 1500;
def flatten = (GetTime() >= lastFiveMinuteBar AND GetTime() < endOfTradingTime);
But, it doesn't seem to be working.
Is there a way to get human readable time formatting from the GetTime() function?
Any help is appreciated.