Hi, I want place order when the price is bigger than 5 day moving average and the time is near market close (after 15:45).
when i use at real time trade, it place order at the market open since market open price is higher than 5 day moving average, How to amend it without changing the interval of the chart??
Daily bars have a time number of 000000. Instead of TimeNum(), you could use Now() which is the current system time. But the equality test would only return True for one second. So it would be better to do a test to see if the current system time is greater than 154500 and less than 154600.