Going to apologize in advance because this may be a newbie question, but I have a paper trading algo that when the orders are submitted in the OnData object, they get 'stuck' as just submitted and never filled. I'm scratching my head a bit - I'm using custom universe selection and that seems to be returning data OK, the error just seems to occur when orders are being placed. I'm also only interested in filling the orders once per day - not sure if how I'm accomodating that below is the most efficient way.

Any insight would be greatly appreciated! Thanks in advance!

def OnData(self, slice):

# only once per day
if self.previous is not None and self.previous.date() == self.Time.date(): return

if slice.Bars.Count == 0: return

percentage = 1 / d.Decimal(slice.Bars.Count)
for tradeBar in slice.Bars.Values:
self.SetHoldings(tradeBar.Symbol, percentage)
self.previous = self.Time