Optimization Management
Estimate Optimization Cost
Request
Project, compile and optimization parameters for estimating the cost of an optimization job. The /optimizations/estimate
API accepts requests in the following format:
EstimateOptimizationRequest Model - Request to estimate the cost of an optimization job. | |
---|---|
projectId | integer Project ID of the project the optimization belongs to. |
name | string Name of the optimization. |
target | string Target of the optimization. |
targetTo | string Target extremum of the optimization. |
targetValue | float Optimization target value. |
strategy | string Optimization strategy. |
compileId | string Optimization compile ID. |
parameters | OptimizationParameter Array Optimization parameters. |
constraints | OptimizationConstraint Array Optimization constraints. |
Example |
{ "projectId": 0, "name": "string", "target": "string", "targetTo": "max or min", "targetValue": , "strategy": "QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy", "compileId": "string", "parameters": [ { "name": "rsi_period", "min": 10, "max": 20, "step": 1, "minStep": 1 } ], "constraints": [ { "target": "TotalPerformance.PortfolioStatistics.SharpeRatio", "operator": "greater", "targetValue": 1 } ] } |
OptimizationParameter Model | |
---|---|
name | string Name of optimization parameter. |
min | float Minimum value of optimization parameter, applicable for boundary conditions. |
max | float Maximum value of optimization parameter, applicable for boundary conditions. |
step | float Movement, should be positive. |
minStep | float Minimal possible movement for current parameter, should be positive. Used by Strategies.EulerSearchOptimizationStrategy to determine when this parameter can no longer be optimized. |
Example |
{ "name": "rsi_period", "min": 10, "max": 20, "step": 1, "minStep": 1 } |
OptimizationConstraint Model | |
---|---|
target | string Property we want to track. |
operator | string The target comparison operation. |
targetValue | float The value of the property we want to track. |
Example |
{ "target": "TotalPerformance.PortfolioStatistics.SharpeRatio", "operator": "greater", "targetValue": 1 } |
Responses
The /optimizations/estimate
API provides a response in the following format:
200 Success
EstimateOptimizationResponse Model - Response received when estimating the cost of an optimization. | |
---|---|
estimate | Estimate object Response received when estimating the cost of an optimization. |
success | boolean Indicate if the API request was successful. |
errors | string Array List of errors with the API call. |
Example |
{ "estimate": { "estimateId": "string", "time": 60, "balance": 10 }, "success": true, "errors": [ "string" ] } |
Estimate Model - Response received when estimating the cost of an optimization. | |
---|---|
estimateId | string Estimate Id. |
time | integer Estimate time in seconds. |
balance | integer Estimate balance in QCC. |
Example |
{ "estimateId": "string", "time": 60, "balance": 10 } |
401 Authentication Error
UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash. | |
---|---|
www_authenticate | string Header |