Bezna$
New member
I am trying to get the latest possible close before Midnight. Some stocks don't trade overnight.
I tried this but it only works for stocks that trade overnight. Any help? TIA
I tried this but it only works for stocks that trade overnight. Any help? TIA
Code:
def TimeMidnight = 0000;
def SecMidnight = SecondsTillTime(TimeMidnight);
def beforeMidnight = SecMidnight <= 0;
rec CloseMidnight = if beforeMidnight then Close else CloseMidnight[1];