INNER CODE UNIT · Python
on_data
Fincept-Corporation/FinceptTerminal · fincept-qt/scripts/strategies/main.py:26
def on_data(self, data):
'''on_data event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
if not self.portfolio.invested:
self.set_holdings("SPY", 1)