I am writing a strategy that trades Equities and uses 2 time frames, LTF (Lower Time Frame) and HTF( Higher Time Frame). The LTF will always be in minutes (5 min, 15 min, etc). The HTF may be in minutes (30, 60, 120 etc). It can also be daily, weekly or monthly.
The entry/exit decisions are done at the end of the HTF bar. Market Orders are placed for the open of the next bar. For backtesting this is not an issue. However for Real Time Trading, at the end of the day (even if the HTF is in minutes), I want to place the trade before the end of the day. I don't want to place a market order for the open of the next day. I have a few questions
1) Is there a way for the strategy to determine, in real time, that the current time is x minutes or y seconds from the end of the current trading day?
2) Will this method "know" if "today" is a short trading day
3) If using weekly or monthly bars on the HTF, is there a way to determine if "today" the current day, is the end of the week or end of the month?
Comment