I am looking for some way to identify, inside my NinjaScript, that I am at the end of the current trading day. I would like to place a stop order at that time, that can be executed, at the earliest, on the open of the following trading day.
I could possibly check OnBarUpdate() of the 1 Minute Bars and see if Time[0] = ClosingTimeOfTheMarket, then place the stop order for the next day, but the problem is that there may be no trading for the last few minutes, and so Time[0] might never equal ClosingTimeOfTheMarket on a given trading day.
Also, I can't find any custom NinjaScript events like "OnClose()".
What are my options for placing a stop order at or near the end of the day, for execution on the next day, at the earliest?
Thank you very much in advance!
ChiTrader2000
Comment