[](https://www.factset.com)
# Optimization Engine API (Multi-period) client library for Python
[](https://pypi.org/project/fds.sdk.OptimizationEngineAPIMultiperiod/)
[](https://www.apache.org/licenses/LICENSE-2.0)
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1
- Package version: 0.21.2
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements
* Python >= 3.7
## Installation
### Poetry
```shell
poetry add fds.sdk.utils fds.sdk.OptimizationEngineAPIMultiperiod
```
### pip
```shell
pip install fds.sdk.utils fds.sdk.OptimizationEngineAPIMultiperiod
```
## Usage
1. [Generate authentication credentials](../../../../README.md#authentication).
2. Setup Python environment.
1. Install and activate python 3.7+. If you're using [pyenv](https://github.com/pyenv/pyenv):
```sh
pyenv install 3.9.7
pyenv shell 3.9.7
```
2. (optional) [Install poetry](https://python-poetry.org/docs/#installation).
3. [Install dependencies](#installation).
4. Run the following:
```python
from fds.sdk.utils.authentication import ConfidentialClient
import fds.sdk.OptimizationEngineAPIMultiperiod
from fds.sdk.OptimizationEngineAPIMultiperiod.api import default_api
from fds.sdk.OptimizationEngineAPIMultiperiod.models import *
from dateutil.parser import parse as dateutil_parser
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
# Examples for each supported authentication method are below,
# choose one that satisfies your use case.
# (Preferred) OAuth 2.0: FactSetOAuth2
# See https://github.com/FactSet/enterprise-sdk#oauth-20
# for information on how to create the app-config.json file
# See https://github.com/FactSet/enterprise-sdk-utils-python#authentication
# for more information on using the ConfidentialClient class
configuration = fds.sdk.OptimizationEngineAPIMultiperiod.Configuration(
fds_oauth_client=ConfidentialClient('/path/to/app-config.json')
)
# Basic authentication: FactSetApiKey
# See https://github.com/FactSet/enterprise-sdk#api-key
# for information how to create an API key
# configuration = fds.sdk.OptimizationEngineAPIMultiperiod.Configuration(
# username='USERNAME-SERIAL',
# password='API-KEY'
# )
# Enter a context with an instance of the API client
with fds.sdk.OptimizationEngineAPIMultiperiod.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = default_api.DefaultApi(api_client)
multi_period_input = OptimizerInputsMultiPeriodInput(
strategy=OptimizerInputsMultiPeriodStrategy(
objective=OptimizerInputsMultiPeriodObjective(
factor_exposure=[
OptimizerInputsMPFactorExposureTerm(
term=OptimizerInputsFactorExposureTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
factors=[
"factors_example",
],
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
volatility=[
OptimizerInputsMPVolatilityTerm(
term=OptimizerInputsVolatilityTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
risk_type=OptimizerInputsEObjectiveRiskTypeEnum(0),
factors=[
"factors_example",
],
active_risk=True,
benchmark_index=1,
),
term_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
general_linear=[
OptimizerInputsMPGeneralLinearTerm(
term=OptimizerInputsGeneralLinearTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
attribute=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
method=OptimizerInputsEAggregationMethodEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
expected_return=[
OptimizerInputsMPExpectedReturnTerm(
term=OptimizerInputsExpectedReturnTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
return_values=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
use_alpha=True,
rel_to_benchmark=True,
benchmark_index=1,
),
term_on=OptimizerInputsBoundSourceEnum(0),
annualization_factor=3.14,
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
sensitivity=[
OptimizerInputsMPSensitivityTerm(
term=OptimizerInputsSensitivityTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
sensitivity_attribute=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
objective_ratio=OptimizerInputsMPObjectiveRatioTerm(
sharpe_ratio=OptimizerInputsSharpeRatioTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
risk_free_rate=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
active_risk=True,
benchmark_index=1,
),
starr=OptimizerInputsSTARRTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
risk_free_rate=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
confidence_level=3.14,
use_centered_etl=True,
active_risk=True,
benchmark_index=1,
),
diversification_ratio=OptimizerInputsDiversificationRatioTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
tail_risk=[
OptimizerInputsMPTailRiskTerm(
term=OptimizerInputsTailRiskTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
risk_measure=OptimizerInputsTailRiskMeasureEnum(0),
confidence_level=3.14,
use_centered_etl=True,
active_risk=True,
benchmark_index=1,
),
term_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
target_probability=[
OptimizerInputsMPTargetProbabilityTerm(
term=OptimizerInputsTargetProbabilityTerm(
name="name_example",
multiplier=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
direction=OptimizerInputsEObjectiveTermDirectionEnum(0),
threshold_min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
threshold_max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
constrain_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
),
constraints=OptimizerInputsMultiPeriodConstraints(
expected_returns=[
OptimizerInputsMPExpectedReturnConstraint(
constraint=OptimizerInputsExpectedReturnConstraint(
name="name_example",
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
return_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
use_strategy_return_value=True,
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
return_type=OptimizerInputsEConstraintReturnTypeEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
hierarchy=1,
),
constraint_on=OptimizerInputsBoundSourceEnum(0),
annualization_factor=3.14,
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
diversification=[
OptimizerInputsMPDiversificationConstraint(
constraint=OptimizerInputsDiversificationConstraint(
name="name_example",
asset_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_percent=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
unit=OptimizerInputsEConstraintUnitTypeEnum(0),
level=OptimizerInputsEConstraintLevelEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
factor_exposures=[
OptimizerInputsMPFactorExposureConstraint(
constraint=OptimizerInputsFactorExposureConstraint(
name="name_example",
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
rel_to_benchmark=True,
benchmark_index=1,
factors=OptimizerInputsFactorExposureAttributes(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
hierarchy=1,
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
general_linear=[
OptimizerInputsMPGeneralLinearConstraint(
constraint=OptimizerInputsGeneralLinearConstraint(
name="name_example",
security_attribute=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
weighting_method=OptimizerInputsEWeightingMethodTypeEnum(0),
level=OptimizerInputsEConstraintLevelEnum(0),
hierarchy=1,
rel_to_benchmark=True,
benchmark_index=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
holding_threshold=[
OptimizerInputsMPHoldingsThresholdConstraint(
constraint=OptimizerInputsHoldingsThresholdConstraint(
name="name_example",
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
level=OptimizerInputsEConstraintLevelEnum(0),
unit=OptimizerInputsEConstraintUnitTypeEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
leverage=[
OptimizerInputsMPLeverageConstraint(
constraint=OptimizerInputsLeverageConstraint(
name="name_example",
value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
value_type=OptimizerInputsELeverageValueTypeEnum(0),
hierarchy=1,
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
num_of_assets=[
OptimizerInputsMPNumberofAssetsConstraint(
constraint=OptimizerInputsNumberofAssetsConstraint(
name="name_example",
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
sensitivity=[
OptimizerInputsMPSensitivityConstraint(
constraint=OptimizerInputsSensitivityConstraint(
name="name_example",
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
sensitivity_attribute=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
hierarchy=1,
unit=OptimizerInputsEConstraintUnitTypeEnum(0),
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
weight_constraint=[
OptimizerInputsMPHoldingsWeightConstraint(
constraint=OptimizerInputsHoldingsWeightConstraint(
name="name_example",
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
unit=OptimizerInputsEConstraintUnitTypeEnum(0),
weight_type=OptimizerInputsEFPOConstraintWeightTypeEnum(0),
level=OptimizerInputsEConstraintLevelEnum(0),
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
rel_to_benchmark=True,
benchmark_index=1,
hierarchy=1,
apply_only_to_direct=True,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
number_of_buys=[
OptimizerInputsMPNumberOfBuysConstraint(
constraint=OptimizerInputsNumberOfBuysConstraint(
name="name_example",
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
number_of_sells=[
OptimizerInputsMPNumberOfSellsConstraint(
constraint=OptimizerInputsNumberOfSellsConstraint(
name="name_example",
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
round_lots=[
OptimizerInputsMPRoundlotsConstraint(
constraint=OptimizerInputsRoundlotsConstraint(
name="name_example",
asset_level=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
general_value=3.14,
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
trade_threshold=[
OptimizerInputsMPTradeThresholdConstraint(
constraint=OptimizerInputsTradeThresholdConstraint(
name="name_example",
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
unit=OptimizerInputsEConstraintUnitTypeEnum(0),
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
trading_turnover=[
OptimizerInputsMPTurnoverConstraint(
constraint=OptimizerInputsTurnoverConstraint(
name="name_example",
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
value_type=OptimizerInputsEConstraintValueTypeEnum(0),
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
turnover_type=OptimizerInputsEConstraintTurnoverTypeEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
risk_contribution=[
OptimizerInputsMPRiskContributionConstraint(
constraint=OptimizerInputsRiskContributionConstraint(
name="name_example",
max_percent=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
custom_asset=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
level=OptimizerInputsEConstraintLevelEnum(0),
asset_type=OptimizerInputsEFPOConstraintAssetTypeEnum(0),
risk_type=OptimizerInputsEConstraintRiskTypeEnum(0),
hierarchy=1,
),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
risk_volatility=[
OptimizerInputsMPRiskVolatilityConstraint(
constraint=OptimizerInputsRiskVolatilityConstraint(
name="name_example",
max_value_of_risk=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
level=OptimizerInputsEConstraintLevelEnum(0),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
groups=[
OptimizerInputsConstraintGroup(
min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
id="id_example",
nested_groups=[],
group_lookup_index=1,
),
],
risk_type=OptimizerInputsEConstraintRiskTypeEnum(0),
active_risk=True,
benchmark_index=1,
hierarchy=1,
),
constraint_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
tail_risk=[
OptimizerInputsMPLimitTailRiskConstraint(
constraint=OptimizerInputsLimitTailRiskConstraint(
name="name_example",
risk_measure=OptimizerInputsTailRiskMeasureEnum(0),
max_risk=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
confidence_level=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
penalty=OptimizerInputsPenalty(
enabled=True,
penalty_type=OptimizerInputsEConstraintPenaltyTypeEnum(0),
penalty_value=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_violation=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
active_risk=True,
benchmark_index=1,
hierarchy=1,
),
constraint_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
target_probability=[
OptimizerInputsMPTargetProbabilityConstraint(
constraint=OptimizerInputsTargetProbabilityConstraint(
name="name_example",
threshold_min=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
threshold_max=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
min_probability=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
max_probability=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
hierarchy=1,
),
constraint_on=OptimizerInputsBoundSourceEnum(0),
on_periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
across_periods=OptimizerInputsAcrossPeriods(
start_period=1,
end_period=1,
rolling=OptimizerInputsAcrossPeriodsRollingPeriods(
frequency=1,
method=OptimizerInputsRollingMethodEnum(0),
),
),
),
],
),
transaction_cost=OptimizerInputsTransactionCost(
unit_type=OptimizerInputsETransactionCostUnitTypeEnum(0),
buy_cost=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
sell_cost=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
),
options=OptimizerInputsMultiPeriodOptions(
options=OptimizerInputsOptions(
max_run_time=1,
convergence_tolerance=3.14,
cash_flow_formula=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
convert_weights_to_cash_for_ip=True,
convert_weights_to_cash_for_bmk=True,
composite_asset_lookthrough_level=1,
),
weight_rebalance_periods=[
1,
],
total_periods_count=1,
initial_point_randomization_count=1,
),
expected_return=OptimizerInputsExpectedReturn(
alpha=OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
alpha_unit=OptimizerInputsEAlphaUnitTypeEnum(0),
),
),
universe=OptimizerInputsTotalUniverse(
assets=[
OptimizerInputsAsset(
symbol="symbol_example",
price=3.14,
),
],
composite_assets=OptimizerInputsCompositeAsset(
constituents=[
OptimizerInputsCompositeConstituent(
univ_index=1,
weight=3.14,
price=OptimizerInputsAssetPrice(
source=OptimizerInputsAssetPriceEPriceSource(0),
price_override=3.14,
),
),
],
),
derivatives=OptimizerInputsDerivative(
offset_index=1,
future=OptimizerInputsDerivativeFuture(
contract_size=3.14,
method=OptimizerInputsDerivativeFutureEComputationMethodEnum(0),
using_pa_multiply=True,
),
forward=True,
),
),
portfolios=OptimizerInputsPortfolios(
initial=OptimizerInputsPortfolio(
holdings=[
OptimizerInputsPortfolioItem(
univ_index=1,
price=OptimizerInputsAssetPrice(
source=OptimizerInputsAssetPriceEPriceSource(0),
price_override=3.14,
),
shares=3.14,
),
],
),
benchmarks=[
OptimizerInputsPortfolio(
holdings=[
OptimizerInputsPortfolioItem(
univ_index=1,
price=OptimizerInputsAssetPrice(
source=OptimizerInputsAssetPriceEPriceSource(0),
price_override=3.14,
),
shares=3.14,
),
],
),
],
buylist=[
OptimizerInputsBuyListItem(
univ_index=1,
price=OptimizerInputsAssetPrice(
source=OptimizerInputsAssetPriceEPriceSource(0),
price_override=3.14,
),
),
],
cash_univ_index=1,
),
riskmodels=OptimizerInputsMultiPeriodRiskModels(
risk_models=[
OptimizerInputsRiskModelForPeriods(
risk_model=OptimizerInputsRiskModel(
simulated_risk_model=OptimizerInputsSimulatedRiskModel(
raw_data=VARDistributionDataMessage(
description=VARDistributionDescription(
risk_model="risk_model_example",
factor_group="factor_group_example",
factors=[
"factors_example",
],
distribution_type=VARDistributionType(0),
report_date=1,
report_currency="report_currency_example",
horizon_in_trading_days=3.14,
return_dates=[
1,
],
),
security_simulations=[
VARSimulatedReturns(
entity="entity_example",
returns=[
3.14,
],
),
],
status=VARDistributionStatus(
indicator=VARStatusIndicator(0),
message="message_example",
),
),
request_info=OptimizerInputsSimulatedRiskRequestInfo(
url="url_example",
lima_header="lima_header_example",
),
),
quant_risk_model=OptimizerInputsQuantRiskModel(
raw_data=OptimizerInputsQuantRiskModelRawData(
labels=OptimizerInputsLabels(
factor=OptimizerInputsFactor(
ids=[
"ids_example",
],
names=[
"names_example",
],
),
security=OptimizerInputsSecurity(
ids=[
"ids_example",
],
),
),
raw_asset_covariance_matrix=OptimizerInputsSparseMatrix(
rows=1,
columns=1,
index_pointer=[
1,
],
indices=[
1,
],
value=[
3.14,
],
),
raw_factor_exposure=OptimizerInputsSparseMatrix(
rows=1,
columns=1,
index_pointer=[
1,
],
indices=[
1,
],
value=[
3.14,
],
),
raw_factor_covariance_matrix=OptimizerInputsDenseMatrix(
value=[
GoogleProtobufListValue(
values=[
OptimizerInputsValue(
value_type=OptimizerInputsEValueTypeEnum(0),
raw_value=3.14,
ref_index=1,
),
],
),
],
),
risk_model_coverage_flag=[
1,
],
),
request_info=OptimizerInputsQuantRiskRequestInfo(
service_url="service_url_example",
json_post_body="json_post_body_example",
lima_header="lima_header_example",
pickup_base_url="pickup_base_url_example",
),
),
raw_model=OptimizerInputsRawRiskModel(
simulations=[
OptimizerInputsRawRiskModelSimulations(
id="id_example",
simulated_returns=[
3.14,
],
),
],
),
),
periods=OptimizerInputsOnPeriods(
periods=[
1,
],
),
),
],
),
lookup_tables=OptimizerInputsLookupTables(
groups=[
OptimizerInputsGroupDefinition(
univ_indices=[
1,
],
),
],
values=[
OptimizerInputsValueReference(
asset_values=3.14,
),
],
),
output_statistics=True,
) # OptimizerInputsMultiPeriodInput | Multiperiod protobuf input (optional)
try:
api_response = api_instance.mpo_v1_optimize_fpo_post(multi_period_input=multi_period_input)
pprint(api_response)
except fds.sdk.OptimizationEngineAPIMultiperiod.ApiException as e:
print("Exception when calling DefaultApi->mpo_v1_optimize_fpo_post: %s\n" % e)
# Get response, http status code and response headers
# try:
# api_response, http_status_code, response_headers = api_instance.mpo_v1_optimize_fpo_post_with_http_info(multi_period_input=multi_period_input)
# pprint(api_response)
# pprint(http_status_code)
# pprint(response_headers)
# except fds.sdk.OptimizationEngineAPIMultiperiod.ApiException as e:
# print("Exception when calling DefaultApi->mpo_v1_optimize_fpo_post: %s\n" % e)
# Get response asynchronous
# try:
# async_result = api_instance.mpo_v1_optimize_fpo_post_async(multi_period_input=multi_period_input)
# api_response = async_result.get()
# pprint(api_response)
# except fds.sdk.OptimizationEngineAPIMultiperiod.ApiException as e:
# print("Exception when calling DefaultApi->mpo_v1_optimize_fpo_post: %s\n" % e)
# Get response, http status code and response headers asynchronous
# try:
# async_result = api_instance.mpo_v1_optimize_fpo_post_with_http_info_async(multi_period_input=multi_period_input)
# api_response, http_status_code, response_headers = async_result.get()
# pprint(api_response)
# pprint(http_status_code)
# pprint(response_headers)
# except fds.sdk.OptimizationEngineAPIMultiperiod.ApiException as e:
# print("Exception when calling DefaultApi->mpo_v1_optimize_fpo_post: %s\n" % e)
```
### Using Pandas
To convert an API response to a Pandas DataFrame, it is necessary to transform it first to a dictionary.
```python
import pandas as pd
response_dict = api_response.to_dict()['data']
simple_json_response = pd.DataFrame(response_dict)
nested_json_response = pd.json_normalize(response_dict)
```
### Debugging
The SDK uses the standard library [`logging`](https://docs.python.org/3/library/logging.html#module-logging) module.
Setting `debug` to `True` on an instance of the `Configuration` class sets the log-level of related packages to `DEBUG`
and enables additional logging in Pythons [HTTP Client](https://docs.python.org/3/library/http.client.html).
**Note**: This prints out sensitive information (e.g. the full request and response). Use with care.
```python
import logging
import fds.sdk.OptimizationEngineAPIMultiperiod
logging.basicConfig(level=logging.DEBUG)
configuration = fds.sdk.OptimizationEngineAPIMultiperiod.Configuration(...)
configuration.debug = True
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**mpo_v1_optimize_fpo_post**](docs/DefaultApi.md#mpo_v1_optimize_fpo_post) | **POST** /mpo/v1/optimizeFPO |
## Documentation For Models
- [GoogleProtobufListValue](docs/GoogleProtobufListValue.md)
- [GoogleProtobufNullValue](docs/GoogleProtobufNullValue.md)
- [GoogleProtobufStruct](docs/GoogleProtobufStruct.md)
- [GoogleProtobufValue](docs/GoogleProtobufValue.md)
- [OptimizerInputsAcrossPeriods](docs/OptimizerInputsAcrossPeriods.md)
- [OptimizerInputsAcrossPeriodsRollingPeriods](docs/OptimizerInputsAcrossPeriodsRollingPeriods.md)
- [OptimizerInputsAsset](docs/OptimizerInputsAsset.md)
- [OptimizerInputsAssetPrice](docs/OptimizerInputsAssetPrice.md)
- [OptimizerInputsAssetPriceEPriceSource](docs/OptimizerInputsAssetPriceEPriceSource.md)
- [OptimizerInputsBoundSourceEnum](docs/OptimizerInputsBoundSourceEnum.md)
- [OptimizerInputsBuyListItem](docs/OptimizerInputsBuyListItem.md)
- [OptimizerInputsCompositeAsset](docs/OptimizerInputsCompositeAsset.md)
- [OptimizerInputsCompositeConstituent](docs/OptimizerInputsCompositeConstituent.md)
- [OptimizerInputsConstraintGroup](docs/OptimizerInputsConstraintGroup.md)
- [OptimizerInputsConstraints](docs/OptimizerInputsConstraints.md)
- [OptimizerInputsDenseMatrix](docs/OptimizerInputsDenseMatrix.md)
- [OptimizerInputsDerivative](docs/OptimizerInputsDerivative.md)
- [OptimizerInputsDerivativeFuture](docs/OptimizerInputsDerivativeFuture.md)
- [OptimizerInputsDerivativeFutureEComputationMethodEnum](docs/OptimizerInputsDerivativeFutureEComputationMethodEnum.md)
- [OptimizerInputsDiversificationConstraint](docs/OptimizerInputsDiversificationConstraint.md)
- [OptimizerInputsDiversificationRatioTerm](docs/OptimizerInputsDiversificationRatioTerm.md)
- [OptimizerInputsDrawdownTerm](docs/OptimizerInputsDrawdownTerm.md)
- [OptimizerInputsEAggregationMethodEnum](docs/OptimizerInputsEAggregationMethodEnum.md)
- [OptimizerInputsEAlphaUnitTypeEnum](docs/OptimizerInputsEAlphaUnitTypeEnum.md)
- [OptimizerInputsEConstraintGroupTypeEnum](docs/OptimizerInputsEConstraintGroupTypeEnum.md)
- [OptimizerInputsEConstraintLevelEnum](docs/OptimizerInputsEConstraintLevelEnum.md)
- [OptimizerInputsEConstraintPenaltyTypeEnum](docs/OptimizerInputsEConstraintPenaltyTypeEnum.md)
- [OptimizerInputsEConstraintReturnTypeEnum](docs/OptimizerInputsEConstraintReturnTypeEnum.md)
- [OptimizerInputsEConstraintRiskRelativeInterpretationTypeEnum](docs/OptimizerInputsEConstraintRiskRelativeInterpretationTypeEnum.md)
- [OptimizerInputsEConstraintRiskTypeEnum](docs/OptimizerInputsEConstraintRiskTypeEnum.md)
- [OptimizerInputsEConstraintTurnoverTypeEnum](docs/OptimizerInputsEConstraintTurnoverTypeEnum.md)
- [OptimizerInputsEConstraintUnitTypeEnum](docs/OptimizerInputsEConstraintUnitTypeEnum.md)
- [OptimizerInputsEConstraintValueTypeEnum](docs/OptimizerInputsEConstraintValueTypeEnum.md)
- [OptimizerInputsEFPOConstraintAssetTypeEnum](docs/OptimizerInputsEFPOConstraintAssetTypeEnum.md)
- [OptimizerInputsEFPOConstraintWeightTypeEnum](docs/OptimizerInputsEFPOConstraintWeightTypeEnum.md)
- [OptimizerInputsELeverageValueTypeEnum](docs/OptimizerInputsELeverageValueTypeEnum.md)
- [OptimizerInputsEObjectiveRiskTypeEnum](docs/OptimizerInputsEObjectiveRiskTypeEnum.md)
- [OptimizerInputsEObjectiveTermDirectionEnum](docs/OptimizerInputsEObjectiveTermDirectionEnum.md)
- [OptimizerInputsETransactionCostUnitTypeEnum](docs/OptimizerInputsETransactionCostUnitTypeEnum.md)
- [OptimizerInputsEValueTypeEnum](docs/OptimizerInputsEValueTypeEnum.md)
- [OptimizerInputsEWeightingMethodTypeEnum](docs/OptimizerInputsEWeightingMethodTypeEnum.md)
- [OptimizerInputsExpectedReturn](docs/OptimizerInputsExpectedReturn.md)
- [OptimizerInputsExpectedReturnConstraint](docs/OptimizerInputsExpectedReturnConstraint.md)
- [OptimizerInputsExpectedReturnTerm](docs/OptimizerInputsExpectedReturnTerm.md)
- [OptimizerInputsExpectedTailLossTerm](docs/OptimizerInputsExpectedTailLossTerm.md)
- [OptimizerInputsFactor](docs/OptimizerInputsFactor.md)
- [OptimizerInputsFactorExposureAttributes](docs/OptimizerInputsFactorExposureAttributes.md)
- [OptimizerInputsFactorExposureConstraint](docs/OptimizerInputsFactorExposureConstraint.md)
- [OptimizerInputsFactorExposureTerm](docs/OptimizerInputsFactorExposureTerm.md)
- [OptimizerInputsFrontierSettings](docs/OptimizerInputsFrontierSettings.md)
- [OptimizerInputsGeneralLinearConstraint](docs/OptimizerInputsGeneralLinearConstraint.md)
- [OptimizerInputsGeneralLinearTerm](docs/OptimizerInputsGeneralLinearTerm.md)
- [OptimizerInputsGroupDefinition](docs/OptimizerInputsGroupDefinition.md)
- [OptimizerInputsHoldingsThresholdConstraint](docs/OptimizerInputsHoldingsThresholdConstraint.md)
- [OptimizerInputsHoldingsWeightConstraint](docs/OptimizerInputsHoldingsWeightConstraint.md)
- [OptimizerInputsLabels](docs/OptimizerInputsLabels.md)
- [OptimizerInputsLeverageConstraint](docs/OptimizerInputsLeverageConstraint.md)
- [OptimizerInputsLimitRiskETLConstraint](docs/OptimizerInputsLimitRiskETLConstraint.md)
- [OptimizerInputsLimitTailRiskConstraint](docs/OptimizerInputsLimitTailRiskConstraint.md)
- [OptimizerInputsLookupTables](docs/OptimizerInputsLookupTables.md)
- [OptimizerInputsMPDiversificationConstraint](docs/OptimizerInputsMPDiversificationConstraint.md)
- [OptimizerInputsMPExpectedReturnConstraint](docs/OptimizerInputsMPExpectedReturnConstraint.md)
- [OptimizerInputsMPExpectedReturnTerm](docs/OptimizerInputsMPExpectedReturnTerm.md)
- [OptimizerInputsMPFactorExposureConstraint](docs/OptimizerInputsMPFactorExposureConstraint.md)
- [OptimizerInputsMPFactorExposureTerm](docs/OptimizerInputsMPFactorExposureTerm.md)
- [OptimizerInputsMPFrontierInput](docs/OptimizerInputsMPFrontierInput.md)
- [OptimizerInputsMPGeneralLinearConstraint](docs/OptimizerInputsMPGeneralLinearConstraint.md)
- [OptimizerInputsMPGeneralLinearTerm](docs/OptimizerInputsMPGeneralLinearTerm.md)
- [OptimizerInputsMPHoldingsThresholdConstraint](docs/OptimizerInputsMPHoldingsThresholdConstraint.md)
- [OptimizerInputsMPHoldingsWeightConstraint](docs/OptimizerInputsMPHoldingsWeightConstraint.md)
- [OptimizerInputsMPLeverageConstraint](docs/OptimizerInputsMPLeverageConstraint.md)
- [OptimizerInputsMPLimitTailRiskConstraint](docs/OptimizerInputsMPLimitTailRiskConstraint.md)
- [OptimizerInputsMPNumberOfBuysConstraint](docs/OptimizerInputsMPNumberOfBuysConstraint.md)
- [OptimizerInputsMPNumberOfSellsConstraint](docs/OptimizerInputsMPNumberOfSellsConstraint.md)
- [OptimizerInputsMPNumberofAssetsConstraint](docs/OptimizerInputsMPNumberofAssetsConstraint.md)
- [OptimizerInputsMPObjectiveRatioTerm](docs/OptimizerInputsMPObjectiveRatioTerm.md)
- [OptimizerInputsMPRiskContributionConstraint](docs/OptimizerInputsMPRiskContributionConstraint.md)
- [OptimizerInputsMPRiskVolatilityConstraint](docs/OptimizerInputsMPRiskVolatilityConstraint.md)
- [OptimizerInputsMPRoundlotsConstraint](docs/OptimizerInputsMPRoundlotsConstraint.md)
- [OptimizerInputsMPSensitivityConstraint](docs/OptimizerInputsMPSensitivityConstraint.md)
- [OptimizerInputsMPSensitivityTerm](docs/OptimizerInputsMPSensitivityTerm.md)
- [OptimizerInputsMPTailRiskTerm](docs/OptimizerInputsMPTailRiskTerm.md)
- [OptimizerInputsMPTargetProbabilityConstraint](docs/OptimizerInputsMPTargetProbabilityConstraint.md)
- [OptimizerInputsMPTargetProbabilityTerm](docs/OptimizerInputsMPTargetProbabilityTerm.md)
- [OptimizerInputsMPTradeThresholdConstraint](docs/OptimizerInputsMPTradeThresholdConstraint.md)
- [OptimizerInputsMPTransactionCostConstraint](docs/OptimizerInputsMPTransactionCostConstraint.md)
- [OptimizerInputsMPTurnoverConstraint](docs/OptimizerInputsMPTurnoverConstraint.md)
- [OptimizerInputsMPVolatilityTerm](docs/OptimizerInputsMPVolatilityTerm.md)
- [OptimizerInputsMultiPeriodConstraints](docs/OptimizerInputsMultiPeriodConstraints.md)
- [OptimizerInputsMultiPeriodInput](docs/OptimizerInputsMultiPeriodInput.md)
- [OptimizerInputsMultiPeriodObjective](docs/OptimizerInputsMultiPeriodObjective.md)
- [OptimizerInputsMultiPeriodOptions](docs/OptimizerInputsMultiPeriodOptions.md)
- [OptimizerInputsMultiPeriodRiskModels](docs/OptimizerInputsMultiPeriodRiskModels.md)
- [OptimizerInputsMultiPeriodStrategy](docs/OptimizerInputsMultiPeriodStrategy.md)
- [OptimizerInputsNumberOfBuysConstraint](docs/OptimizerInputsNumberOfBuysConstraint.md)
- [OptimizerInputsNumberOfSellsConstraint](docs/OptimizerInputsNumberOfSellsConstraint.md)
- [OptimizerInputsNumberofAssetsConstraint](docs/OptimizerInputsNumberofAssetsConstraint.md)
- [OptimizerInputsObjective](docs/OptimizerInputsObjective.md)
- [OptimizerInputsOnPeriods](docs/OptimizerInputsOnPeriods.md)
- [OptimizerInputsOptions](docs/OptimizerInputsOptions.md)
- [OptimizerInputsPenalty](docs/OptimizerInputsPenalty.md)
- [OptimizerInputsPortfolio](docs/OptimizerInputsPortfolio.md)
- [OptimizerInputsPortfolioItem](docs/OptimizerInputsPortfolioItem.md)
- [OptimizerInputsPortfolios](docs/OptimizerInputsPortfolios.md)
- [OptimizerInputsQuantRiskModel](docs/OptimizerInputsQuantRiskModel.md)
- [OptimizerInputsQuantRiskModelRawData](docs/OptimizerInputsQuantRiskModelRawData.md)
- [OptimizerInputsQuantRiskRequestInfo](docs/OptimizerInputsQuantRiskRequestInfo.md)
- [OptimizerInputsRange](docs/OptimizerInputsRange.md)
- [OptimizerInputsRawRiskModel](docs/OptimizerInputsRawRiskModel.md)
- [OptimizerInputsRawRiskModelSimulations](docs/OptimizerInputsRawRiskModelSimulations.md)
- [OptimizerInputsRiskContributionConstraint](docs/OptimizerInputsRiskContributionConstraint.md)
- [OptimizerInputsRiskModel](docs/OptimizerInputsRiskModel.md)
- [OptimizerInputsRiskModelForPeriods](docs/OptimizerInputsRiskModelForPeriods.md)
- [OptimizerInputsRiskParityTerm](docs/OptimizerInputsRiskParityTerm.md)
- [OptimizerInputsRiskVolatilityConstraint](docs/OptimizerInputsRiskVolatilityConstraint.md)
- [OptimizerInputsRollingMethodEnum](docs/OptimizerInputsRollingMethodEnum.md)
- [OptimizerInputsRoundlotsConstraint](docs/OptimizerInputsRoundlotsConstraint.md)
- [OptimizerInputsSTARRTerm](docs/OptimizerInputsSTARRTerm.md)
- [OptimizerInputsSecurity](docs/OptimizerInputsSecurity.md)
- [OptimizerInputsSensitivityConstraint](docs/OptimizerInputsSensitivityConstraint.md)
- [OptimizerInputsSensitivityTerm](docs/OptimizerInputsSensitivityTerm.md)
- [OptimizerInputsSharpeRatioTerm](docs/OptimizerInputsSharpeRatioTerm.md)
- [OptimizerInputsSimulatedRiskModel](docs/OptimizerInputsSimulatedRiskModel.md)
- [OptimizerInputsSimulatedRiskRequestInfo](docs/OptimizerInputsSimulatedRiskRequestInfo.md)
- [OptimizerInputsSparseMatrix](docs/OptimizerInputsSparseMatrix.md)
- [OptimizerInputsSpecificPoints](docs/OptimizerInputsSpecificPoints.md)
- [OptimizerInputsStartEndRange](docs/OptimizerInputsStartEndRange.md)
- [OptimizerInputsTailRiskMeasureEnum](docs/OptimizerInputsTailRiskMeasureEnum.md)
- [OptimizerInputsTailRiskTerm](docs/OptimizerInputsTailRiskTerm.md)
- [OptimizerInputsTargetProbabilityConstraint](docs/OptimizerInputsTargetProbabilityConstraint.md)
- [OptimizerInputsTargetProbabilityTerm](docs/OptimizerInputsTargetProbabilityTerm.md)
- [OptimizerInputsTotalUniverse](docs/OptimizerInputsTotalUniverse.md)
- [OptimizerInputsTradeThresholdConstraint](docs/OptimizerInputsTradeThresholdConstraint.md)
- [OptimizerInputsTradingLimitTradeConstraint](docs/OptimizerInputsTradingLimitTradeConstraint.md)
- [OptimizerInputsTransactionCost](docs/OptimizerInputsTransactionCost.md)
- [OptimizerInputsTransactionCostConstraint](docs/OptimizerInputsTransactionCostConstraint.md)
- [OptimizerInputsTransactionCostTerm](docs/OptimizerInputsTransactionCostTerm.md)
- [OptimizerInputsTurnoverConstraint](docs/OptimizerInputsTurnoverConstraint.md)
- [OptimizerInputsValue](docs/OptimizerInputsValue.md)
- [OptimizerInputsValueReference](docs/OptimizerInputsValueReference.md)
- [OptimizerInputsVolatilityTerm](docs/OptimizerInputsVolatilityTerm.md)
- [OptimizerOutputsMultiPeriodOutput](docs/OptimizerOutputsMultiPeriodOutput.md)
- [OptimizerOutputsPeriods](docs/OptimizerOutputsPeriods.md)
- [VARDistributionDataMessage](docs/VARDistributionDataMessage.md)
- [VARDistributionDescription](docs/VARDistributionDescription.md)
- [VARDistributionStatus](docs/VARDistributionStatus.md)
- [VARDistributionType](docs/VARDistributionType.md)
- [VARSimulatedReturns](docs/VARSimulatedReturns.md)
- [VARStatusIndicator](docs/VARStatusIndicator.md)
## Documentation For Authorization
## FactSetApiKey
- **Type**: HTTP basic authentication
## FactSetOAuth2
- **Type**: OAuth
- **Flow**: application
- **Authorization URL**:
- **Scopes**: N/A
## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in fds.sdk.OptimizationEngineAPIMultiperiod.apis and fds.sdk.OptimizationEngineAPIMultiperiod.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1:
Use specific imports for apis and models like:
- `from fds.sdk.OptimizationEngineAPIMultiperiod.api.default_api import DefaultApi`
- `from fds.sdk.OptimizationEngineAPIMultiperiod.model.pet import Pet`
Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import fds.sdk.OptimizationEngineAPIMultiperiod
from fds.sdk.OptimizationEngineAPIMultiperiod.apis import *
from fds.sdk.OptimizationEngineAPIMultiperiod.models import *
```
## Contributing
Please refer to the [contributing guide](../../../../CONTRIBUTING.md).
## Copyright
Copyright 2022 FactSet Research Systems Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.