Cash flows

Also see Cash flows.

Comments

Also see Comments.

Composition

To change the composition of a portfolio, create a draft with the desired composition. Feel free to update the draft as many times as needed.

$ curl -X PUT -d '{"draft": {"budget": 100000, "positions": [{"instrument_id": 333333, "weight": 0.40},{"instrument_id": 444444, "weight": 0.60}]}}' http://api.adviseonly.com/portfolios/risky-but-performer/draft

At any time, provided that the draft is valid, you can generate a preview of the portfolio if it were to be committed and of the trade that would need to be performed.

$ curl http://api.adviseonly.com/portfolios/risky-but-performer/draft/preview

$ curl http://api.adviseonly.com/portfolios/risky-but-performer/draft/trade

Once you are ready to apply the changes to the portfolio, create a new revision.

$ curl -X POST http://api.adviseonly.com/portfolios/risky-but-performer/revisions

Also see Drafts, Previews, Trades and Revisions.

Copies

Also see Copies.

Draft

Also see Drafts.

Followers

Also see Followers.

Indicators

You can get the portfolio indicator values for a given period.

$ curl http://api.adviseonly.com/portfolios/risky-but-performer/indicators/1_month

Also see Indicators.

Instruments

Also see Instruments.

Models

Also see Models.

Owner

Also see Users.

Previews

Also see Previews.

Publishing

Also see Public portfolios.

Revisions

Also see Revisions.

Also see Search.

Time series

Also see Time series.

Trades

Also see Trades.

Resource representations

{
  "kind": "portfolio",
  "id": integer,
  "name": string,
  "slug": string,
  "created_at": datetime,
  "updated_at": datetime,
  "periods": string[],
  "enabled": boolean,
  "market_value": decimal,
  "published": boolean,
  "goal": string,
  "horizon": string,
  "category": string,
  "strategy": string,
  "rebalancing": string,
  "currency_iso": string,
  "type": string,
  "cash": decimal,
  "parent_id": integer,
  "updated_from_draft_at": datetime,
  "composition_updated_at": datetime,
  "parent_changed": boolean,
  "budget": decimal,
  "model_type": integer,
  "editing": boolean,
  "like_count": integer,
  "premium": boolean,
  "model": boolean,
  "risk_analysis": boolean,
  "model_groups": string[],
  "time_series": [time_series],
  "exante_indicators": {
    "var5": decimal,
    "shortfall_probability": decimal,
    "var1": decimal,
    "risk": decimal,
    "maximum_drawdown_1_month": decimal,
    "volatility": decimal,
    "diversification_index": decimal,
    "cvar5": decimal,
    "cvar1": decimal,
    "maximum_drawdown_1_year": decimal,
    "downside_volatility": decimal,
    "liquidity": decimal
  },
  "expost_indicators_1_month": {
    "performance": decimal,
    "maximum_drawdown": decimal,
    "volatility": decimal,
    "downside_volatility": decimal,
    "sharpe_ratio": decimal,
    "sortino": decimal
  },
  "expost_indicators_1_year": {
    "performance": decimal,
    "maximum_drawdown": decimal,
    "volatility": decimal,
    "downside_volatility": decimal,
    "sharpe_ratio": decimal,
    "sortino": decimal
  },
  "expost_indicators_all": {
    "performance": decimal,
    "maximum_drawdown": decimal,
    "volatility": decimal,
    "downside_volatility": decimal,
    "sharpe_ratio": decimal,
    "sortino": decimal
  },
  "positions": [
    {
      "kind": "position",
      "id": integer,
      "weight": decimal,
      "quantity": integer,
      "market_value": decimal,
      "created_at": datetime,
      "updated_at": datetime,
      "instrument": instrument
    },
    .
    .
    .
  ],
  "riskier_instruments": [
    {
      "instrument": instrument
      "var_contribution": decimal
    },
    .
    .
    .
  ],
  "global_category_positions": [
    {
      "global_category": global_category,
      "weight": decimal
    },
    .
    .
    .
  ],
  "owner": user
}

Methods


POST /portfolios
Create a portfolio.

Create a portfolio.

Params

Param Name Description
portfolio
Required

Portfolio data.


Value:

Must be a Hash

portfolio[name]
Required

The name of the portfolio.


Value:

Must be String

portfolio[type]
Optional

The type of portfolio. Optional. The default is “quantity”.


Value:

Must be one of: quantity, weight.

portfolio[goal]
Optional

The goal of the portfolio.


Value:

Must be String

portfolio[horizon]
Optional

The horizon of the portfolio.


Value:

Must be one of: very_long, long, medium, short, very_short.

portfolio[category]
Optional

The category of the portfolio.


Value:

Must be one of: equity, bond, cash, balanced, flexible, commodities.

portfolio[strategy]
Optional

The strategy of the portfolio.


Value:

Must be String

portfolio[rebalancing]
Optional

The rebalancing frequency of the portfolio.


Value:

Must be one of: weekly, monthly, yearly, variable.


GET /instruments/:instrument_id/portfolios
List all the portfolios in the specified collection.

GET /me/portfolios
List all the portfolios in the specified collection.

GET /portfolios
List all the portfolios in the specified collection.

GET /users/:user_id/portfolios
List all the portfolios in the specified collection.

List all the portfolios in the specified collection.

Filters

Each filter accepts range criteria of the following types:

  • Less than x: ‘,x’
  • Between x and y: ‘x,y’
  • More than x: ‘x,’

Separate multiple criteria for the same filter using the comma character (,).

performance_in=|0.1,0.5|0.6,1|

Filters can be combined.

performance_in=0.4|&sharpe_ratio_in=0.1|0.2

Sort

The results can be sorted based on one or more of the following criteria

  • followers
  • performance
  • risk
  • sharpe_ratio

For each criteria an optional order can be specified using the pipe character (|).

sorted_by=followers|asc

Separate multiple criteria using the comma character (,).

sorted_by=performance|asc,risk

Params

Param Name Description
not_containing
Optional

The slug of instruments whose containing portfolios should be excluded from the results.

Separate multiple values using the comma character (,).

not_containing=apple,google,microsoft

Value:

Must be String

risk_in
Optional

Risk filters.


Value:

Must be String

performance_in
Optional

Performance filters.


Value:

Must be String

sharpe_ratio_in
Optional

Sharpe ratio filters.


Value:

Must be String

sorted_by
Optional

Sort order of results.


Value:

Must be String


GET /portfolios/:id
Get a portfolio.

Get a portfolio.

Params

Param Name Description
id
Required

The slug of the portfolio to get.


Value:

Must be String


PATCH /portfolios/:id
Update a portfolio.

PUT /portfolios/:id
Update a portfolio.

Update a portfolio.

Params

Param Name Description
id
Required

The slug of the portfolio to update.


Value:

Must be String

portfolio
Required

Portfolio data.


Value:

Must be a Hash

portfolio[disabled]
Optional

Whether the portfolio is disabled or not.


Value:

Must be ‘true’ or ‘false’

portfolio[name]
Required

Portfolio name.


Value:

Must be String

portfolio[goal]
Optional

The goal of the portfolio.


Value:

Must be String

portfolio[horizon]
Optional

The horizon of the portfolio.


Value:

Must be one of: very_long, long, medium, short, very_short.

portfolio[category]
Optional

The category of the portfolio.


Value:

Must be one of: equity, bond, cash, balanced, flexible, commodities.

portfolio[strategy]
Optional

The strategy of the portfolio.


Value:

Must be String

portfolio[rebalancing]
Optional

The rebalancing frequency of the portfolio.


Value:

Must be one of: weekly, monthly, yearly, variable.


DELETE /portfolios/:id
Delete a portfolio.

Delete a portfolio.

Params

Param Name Description
id
Required

The slug of the portfolio to delete.


Value:

Must be String