Merge PythonSlice into Slice (#8707)

- To simplify stub generation, merge PythonSlice into Slice, following
  existing pattern too, see QCAlgorithm.Python.cs
- Minor sintax fixes in example python algorithms
This commit is contained in:
Martin-Molinero
2025-04-21 13:37:33 -03:00
committed by GitHub
parent b81bcf086e
commit 4584feb7da
20 changed files with 106 additions and 209 deletions
@@ -48,12 +48,12 @@ from requests import post
class CustomSignalExport:
def send(self, parameters: SignalExportTargetParameters) -> bool:
targets = [PortfolioTarget.percent(parameters.algorithm, x.symbol, x.quantity)
for x in parameters.targets] ;
for x in parameters.targets]
data = [ {'symbol' : x.symbol.value, 'quantity': x.quantity} for x in targets ]
response = post("http://localhost:5000/", json = data)
result = response.json()
success = result.get('success', False)
parameters.algorithm.log(f"Send #{len(parameters.targets)} targets. Success: {success}");
parameters.algorithm.log(f"Send #{len(parameters.targets)} targets. Success: {success}")
return success
def dispose(self):