Optimization Management

Read Optimization

Introduction

Read an optimization.

Request

Optimization ID for the optimization we want to read. The /optimizations/read API accepts requests in the following format:

ReadOptimizationRequest Model - Request to read a optimization from a project.
optimizationId string
Optimization ID for the optimization we want to read.
Example
{
  "optimizationId": "string"
}

Responses

The /optimizations/read API provides a response in the following format:

200 Success

ReadOptimizationResponse Model - Response received when reading an optimization.
optimization Optimization object
Response received when launching an optimization job.
success boolean
Indicate if the API request was successful.
errors string Array
List of errors with the API call.
Example
{
  "optimization": {
    "optimizationId": "string",
    "projectId": "string",
    "name": "string",
    "status": "New",
    "nodeType": "O2-8",
    "parallelNodes": 4,
    "criterion": {
      "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
      "extremum": "max or min",
      "target-value": 1
    },
    "runtimeStatistics": "string",
    "constraints": [
      {
        "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
        "operator": "greater",
        "target-value": 1
      }
    ],
    "parameters": [
      {
        "name": "rsi_period",
        "min": 10,
        "max": 20,
        "step": 1,
        "min-step": 1
      }
    ],
    "backtests": [
      {
        "name": "string",
        "id": "string",
        "progress": "string",
        "exitCode": 0,
        "statistics": "string",
        "parameterSet": "string",
        "equity": "string"
      }
    ],
    "strategy": "QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy",
    "requested": "2021-11-26T15:18:27.693Z"
  },
  "success": true,
  "errors": [
    "string"
  ]
}
Optimization Model - Response received when launching an optimization job.
optimizationId string
Optimization ID.
projectId string
Project ID of the project the optimization belongs to.
name string
Name of the optimization.
status string Enum
Status of the optimization. Options : ['New', 'Aborted', 'Running', 'Completed']
nodeType string Enum
example: O2-8

Optimization node type. Options : ['O2-8', 'O4-12', 'O8-16']
parallelNodes integer
example: 4

Number of parallel nodes for optimization.
criterion OptimizationTarget object
/.
runtimeStatistics string object
Runtime banner/updating statistics for the optimization.
constraints OptimizationConstraint Array
Optimization constraints.
parameters OptimizationParameter Array
Optimization parameters.
backtests OptimizationBacktest Array
Optimization constraints.
strategy string
example: QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy

Optimization strategy.
requested string($date-time)
Optimization requested date and time.
Example
{
  "optimizationId": "string",
  "projectId": "string",
  "name": "string",
  "status": "New",
  "nodeType": "O2-8",
  "parallelNodes": 4,
  "criterion": {
    "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
    "extremum": "max or min",
    "target-value": 1
  },
  "runtimeStatistics": "string",
  "constraints": [
    {
      "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
      "operator": "greater",
      "target-value": 1
    }
  ],
  "parameters": [
    {
      "name": "rsi_period",
      "min": 10,
      "max": 20,
      "step": 1,
      "min-step": 1
    }
  ],
  "backtests": [
    {
      "name": "string",
      "id": "string",
      "progress": "string",
      "exitCode": 0,
      "statistics": "string",
      "parameterSet": "string",
      "equity": "string"
    }
  ],
  "strategy": "QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy",
  "requested": "2021-11-26T15:18:27.693Z"
}
OptimizationTarget Model
target string
example: TotalPerformance.PortfolioStatistics.SharpeRatio

Property we want to track.
extremum string
example: max or min

Defines the direction of optimization.
target-value float
example: 1

The value of the property we want to track.
Example
{
  "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
  "extremum": "max or min",
  "target-value": 1
}
OptimizationConstraint Model
target string
example: TotalPerformance.PortfolioStatistics.SharpeRatio

Property we want to track.
operator string
example: greater

The target comparison operation.
target-value float
example: 1

The value of the property we want to track.
Example
{
  "target": "TotalPerformance.PortfolioStatistics.SharpeRatio",
  "operator": "greater",
  "target-value": 1
}
OptimizationParameter Model
name string
example: rsi_period

Name of optimization parameter.
min float
example: 10

Minimum value of optimization parameter, applicable for boundary conditions.
max float
example: 20

Maximum value of optimization parameter, applicable for boundary conditions.
step float
example: 1

Movement, should be positive.
min-step float
example: 1

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,
  "min-step": 1
}
OptimizationBacktest Model
name string
The backtest name.
id string
The backtest id.
progress string
Progress of the backtest as a percentage from 0-1 based on the days lapsed from start-finish.
exitCode integer
The exit code of this backtest.
statistics string object
The backtest statistics results.
parameterSet string
Represent a combination as key value of parameters, i.e. order doesn't matter.
equity string
The backtest equity chart series.
Example
{
  "name": "string",
  "id": "string",
  "progress": "string",
  "exitCode": 0,
  "statistics": "string",
  "parameterSet": "string",
  "equity": "string"
}

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

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: