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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user