Improves Export Signal Algorithms (#7210)

* Update Collective2PortfolioSignalExportDemonstrationAlgorithm

* Update Collective2SignalExportDemonstrationAlgorithm

* Update CrunchDAOPortfolioSignalExportDemonstrationAlgorithm

* Update CrunchDAOSignalExportDemonstrationAlgorithm

* Update NumeraiPortfolioSignalExportDemonstrationAlgorithm

* Update NumeraiSignalExportDemonstrationAlgorithm

* Address peer review

* Add logic to handle warm up

* Update unit test statistics
This commit is contained in:
Louis Szeto
2023-05-01 23:14:54 +08:00
committed by GitHub
parent a7516b80ea
commit 991ac4595f
12 changed files with 254 additions and 146 deletions
@@ -56,14 +56,21 @@ class NumeraiPortfolioSignalExportDemonstrationAlgorithm(QCAlgorithm):
self.numeraiFilename = "" # Replace this values with your submission filename (Optional)
self.SignalExport.AddSignalExportProviders(NumeraiSignalExport(self.numeraiPublicId, self.numeraiSecretId, self.numeraiModelId, self.numeraiFilename))
self.first_call = True
self.SetWarmUp(100)
def OnData(self, data):
''' Reduce the quantity of holdings for one security and increase the holdings to the another
one when the EMA's indicators crosses between themselves, then send a signal to Numerai API '''
# Wait for our indicators to be ready
if not self.fast.IsReady or not self.slow.IsReady:
return
if self.IsWarmingUp: return
# Place an order as soon as possible to send a signal.
if self.first_call:
self.SetHoldings("SPY", 0.1)
self.SignalExport.SetTargetPortfolioFromPortfolio()
self.first_call = False
fast = self.fast.Current.Value
slow = self.slow.Current.Value