Skip to content

Commit 2da8092

Browse files
committed
Updates Examples to Disable Automatic Export
1 parent 6437840 commit 2da8092

9 files changed

Lines changed: 37 additions & 9 deletions

Algorithm.CSharp/Collective2PortfolioSignalExportDemonstrationAlgorithm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ public override void Initialize()
8080
// Initialize this flag, to check when the ema indicators crosses between themselves
8181
_emaFastIsNotSet = true;
8282

83+
// Disable automatic exports as we manually set them
84+
SignalExport.AutomaticExportTimeSpan = null;
8385
// Set Collective2 signal export provider
84-
SignalExport.AddSignalExportProviders(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
86+
SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
8587

8688
SetWarmUp(100);
8789
}

Algorithm.CSharp/Collective2SignalExportDemonstrationAlgorithm.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,15 @@ public override void Initialize()
9595
// Initialize this flag, to check when the ema indicators crosses between themselves
9696
_emaFastIsNotSet = true;
9797

98+
// Disable automatic exports as we manually set them
99+
SignalExport.AutomaticExportTimeSpan = null;
100+
98101
// Set Collective2 signal export provider.
99102
// If using the Collective2 white-label API, you can specify it in the constructor with the optional parameter `useWhiteLabelApi`:
100103
// e.g. new Collective2SignalExport(_collective2ApiKey, _collective2SystemId, useWhiteLabelApi: true)
101104
// The API url can also be overridden by setting the Destination property:
102105
// e.g. new Collective2SignalExport(_collective2ApiKey, _collective2SystemId) { Destination = new Uri("your url") }
103-
SignalExport.AddSignalExportProviders(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
106+
SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
104107

105108
SetWarmUp(100);
106109
}

Algorithm.CSharp/IndexSecurityCanBeTradableRegressionAlgorithm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public override void Initialize()
4343

4444
_index = AddIndex("SPX").Symbol;
4545
_equity = AddEquity("SPY").Symbol;
46+
SignalExport.AutomaticExportTimeSpan = null;
4647
_signalExportManagerTest = new SignalExportManagerTest(this);
4748
Securities[_index].IsTradable = IsTradable;
4849
}

Algorithm.CSharp/NumeraiSignalExportDemonstrationAlgorithm.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ public override void Initialize()
6464
var numeraiModelId = "";
6565

6666
var numeraiFilename = ""; // (Optional) Replace this value with your submission filename
67-
SignalExport.AddSignalExportProviders(new NumeraiSignalExport(numeraiPublicId, numeraiSecretId, numeraiModelId, numeraiFilename));
67+
68+
// Disable automatic exports as we manually set them
69+
SignalExport.AutomaticExportTimeSpan = null;
70+
71+
// Set Numerai signal export provider
72+
SignalExport.AddSignalExportProvider(new NumeraiSignalExport(numeraiPublicId, numeraiSecretId, numeraiModelId, numeraiFilename));
6873
}
6974

7075
public void SubmitSignals()

Algorithm.CSharp/RegressionTests/Collective2IndexOptionAlgorithm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ public override void Initialize()
6363
_fast = EMA(underlying, 10, Resolution.Minute);
6464
_slow = EMA(underlying, 50, Resolution.Minute);
6565

66+
// Disable automatic exports as we manually set them
67+
SignalExport.AutomaticExportTimeSpan = null;
6668
// Set up the Collective2 Signal Export with the provided API key and system ID
67-
SignalExport.AddSignalExportProviders(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
69+
SignalExport.AddSignalExportProvider(new Collective2SignalExport(_collective2ApiKey, _collective2SystemId));
6870

6971
// Set warm-up period for the indicators
7072
SetWarmUp(50);

Algorithm.Python/Collective2PortfolioSignalExportDemonstrationAlgorithm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def initialize(self):
5454
# Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page
5555
self.collective2_system_id = 0
5656

57-
self.signal_export.add_signal_export_providers(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))
57+
# Disable automatic exports as we manually set them
58+
self.signal_export.automatic_export_time_span = None
59+
60+
# Set Collective2 signal export provider
61+
self.signal_export.add_signal_export_provider(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))
5862

5963
self.first_call = True
6064

Algorithm.Python/Collective2SignalExportDemonstrationAlgorithm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ def initialize(self):
6161
# Collective2 System ID: This value is found beside the system's name (strategy's name) on the main system page
6262
self.collective2_system_id = 0
6363

64+
# Disable automatic exports as we manually set them
65+
self.signal_export.automatic_export_time_span = None
66+
6467
# If using the Collective2 white-label API, you can specify it in the constructor with the optional parameter `use_white_label_api`:
6568
# e.g. Collective2SignalExport(self.collective2_apikey, self.collective2_system_id, use_white_label_api=True)
6669
# The API url can also be overridden by setting the Destination property:
6770
# e.g. Collective2SignalExport(self.collective2_apikey, self.collective2_system_id) { Destination = new Uri("your url") }
68-
self.signal_export.add_signal_export_providers(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))
71+
self.signal_export.add_signal_export_provider(Collective2SignalExport(self.collective2_apikey, self.collective2_system_id))
6972

7073
self.first_call = True
7174

Algorithm.Python/CrunchDAOSignalExportDemonstrationAlgorithm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,18 @@ def initialize(self):
2828
self.set_end_date(2023, 5, 26)
2929
self.set_cash(1_000_000)
3030

31+
# Disable automatic exports as we manually set them
32+
self.signal_export.automatic_export_time_span = None
33+
3134
# Connect to CrunchDAO
3235
api_key = "" # Your CrunchDAO API key
3336
model = "" # The Id of your CrunchDAO model
3437
submission_name = "" # A name for the submission to distinguish it from your other submissions
3538
comment = "" # A comment for the submission
36-
self.signal_export.add_signal_export_providers(CrunchDAOSignalExport(api_key, model, submission_name, comment))
39+
self.signal_export.add_signal_export_provider(CrunchDAOSignalExport(api_key, model, submission_name, comment))
3740

3841
self.set_security_initializer(BrokerageModelSecurityInitializer(self.brokerage_model, FuncSecuritySeeder(self.get_last_known_prices)))
39-
42+
4043
# Add a custom data universe to read the CrunchDAO skeleton
4144
self.add_universe(CrunchDaoSkeleton, "CrunchDaoSkeleton", Resolution.DAILY, self.select_symbols)
4245

Algorithm.Python/NumeraiSignalExportDemonstrationAlgorithm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ def initialize(self):
5555
numerai_model_id = ""
5656

5757
numerai_filename = "" # (Optional) Replace this value with your submission filename
58-
self.signal_export.add_signal_export_providers(NumeraiSignalExport(numerai_public_id, numerai_secret_id, numerai_model_id, numerai_filename))
58+
59+
# Disable automatic exports as we manually set them
60+
self.signal_export.automatic_export_time_span = None
61+
62+
# Set Numerai signal export provider
63+
self.signal_export.add_signal_export_provider(NumeraiSignalExport(numerai_public_id, numerai_secret_id, numerai_model_id, numerai_filename))
5964

6065

6166
def submit_signals(self):

0 commit comments

Comments
 (0)