portfolio-proposal

Example

<cr-component id="component" name="portfolio-proposal"></cr-component>
<script>
  const component = document.querySelector("#component");
  component.init({
    strategyConfiguration: {
      configurationType: "mt16_rm",
      universeType: "rm_european_fund",
      operativeType: "weights",
      timeHorizon: 3,
      riskLevel: 1,
      categories: [
        { tag: "FIXED_INCOME_GOVERNMENT_EUROPE_SHORT_TERM", status: "enabled" },
        { tag: "FIXED_INCOME_GOVERNMENT_EUROPE_FLEXIBLE", status: "enabled" },
        { tag: "FIXED_INCOME_CORPORATE_EUROPE_FLEXIBLE", status: "enabled" },
        { tag: "FIXED_INCOME_HIGH_YIELD_EUROPE", status: "enabled" },
        { tag: "FIXED_INCOME_GLOBAL_EMERGING_MARKETS_HARD_CURRENCY", status: "enabled" },
        { tag: "FIXED_INCOME_GLOBAL_EMERGING_MARKETS_LOCAL_CURRENCY", status: "enabled" },
        { tag: "FIXED_INCOME_INFLATION_LINKED_EUROPE", status: "enabled" },
        { tag: "EQUITY_EUROPE", status: "enabled" },
        { tag: "EQUITY_EUROZONE", status: "enabled" },
        { tag: "EQUITY_GLOBAL", status: "enabled" },
        { tag: "ALTERNATIVE_LOW_VOLATILITY", status: "enabled" },
      ],
      preferences: {
        return: 0.56,
        risk: 0.22,
        popularity: 0.08,
        fees: 0.04,
        esg: 0.1,
      },
    },
    associatedPortfolioId: "P1_modelo_update",
    categoryType: "rentamarkets",
    benchmarkIds: [187829],
    assetsAmounts: [
      {
        symbolId: 146057,
        amount: 20000,
      },
    ],
  });
</script>

Schema

{
 "type": "object",
 "properties": {
  "positions": {
   "type": "array",
   "minItems": 1,
   "description": "The data needed to create the proposal",
   "items": {
    "type": "object",
    "required": [
     "amount"
    ],
    "properties": {
     "symbolId": {
      "type": "number"
     },
     "amount": {
      "type": "number"
     },
     "date": {
      "type": "string"
     },
     "color": {
      "type": "string"
     }
    }
   }
  },
  "strategyConfiguration": {
   "type": "object",
   "additionalProperties": false,
   "description": "Configuration of the strategy. It has to be a valid configuration for the desired strategy",
   "required": [
    "configurationType",
    "universeType",
    "operativeType",
    "riskLevel",
    "categories",
    "preferences"
   ],
   "properties": {
    "configurationType": {
     "enum": [
      "mt16_rm"
     ]
    },
    "universeType": {
     "enum": [
      "rm_european_fund"
     ]
    },
    "operativeType": {
     "enum": [
      "weights"
     ]
    },
    "adaptationLevel": {
     "type": "integer",
     "minimum": 1,
     "maximum": 5
    },
    "timeHorizon": {
     "type": "integer",
     "minimum": 1
    },
    "riskLevel": {
     "type": "integer",
     "minimum": 1,
     "maximum": 7
    },
    "categories": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "tag": {
        "type": "string"
       },
       "status": {
        "enum": [
         "enabled",
         "disabled",
         "favourite"
        ]
       }
      }
     }
    },
    "preferences": {
     "type": "object",
     "properties": {
      "return": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "risk": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "popularity": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "fees": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "esg": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      }
     }
    }
   }
  }
 },
 "additionalProperties": false
}

Complete Schema

{
 "type": "object",
 "completeProperties": {
  "proposalId": {
   "type": "integer",
   "minimum": 1,
   "description": "Proposal identifier"
  },
  "proposal": {
   "type": "object",
   "description": "In case you want to use an already created proposal"
  },
  "positions": {
   "type": "array",
   "minItems": 1,
   "description": "The data needed to create the proposal",
   "items": {
    "type": "object",
    "required": [
     "amount"
    ],
    "properties": {
     "symbolId": {
      "type": "number"
     },
     "amount": {
      "type": "number"
     },
     "date": {
      "type": "string"
     },
     "color": {
      "type": "string"
     }
    }
   }
  },
  "strategyConfiguration": {
   "type": "object",
   "additionalProperties": false,
   "description": "Configuration of the strategy. It has to be a valid configuration for the desired strategy",
   "required": [
    "configurationType",
    "universeType",
    "operativeType",
    "riskLevel",
    "categories",
    "preferences"
   ],
   "properties": {
    "configurationType": {
     "enum": [
      "mt16_rm"
     ]
    },
    "universeType": {
     "enum": [
      "rm_european_fund"
     ]
    },
    "operativeType": {
     "enum": [
      "weights"
     ]
    },
    "adaptationLevel": {
     "type": "integer",
     "minimum": 1,
     "maximum": 5
    },
    "timeHorizon": {
     "type": "integer",
     "minimum": 1
    },
    "riskLevel": {
     "type": "integer",
     "minimum": 1,
     "maximum": 7
    },
    "categories": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "tag": {
        "type": "string"
       },
       "status": {
        "enum": [
         "enabled",
         "disabled",
         "favourite"
        ]
       }
      }
     }
    },
    "preferences": {
     "type": "object",
     "properties": {
      "return": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "risk": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "popularity": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "fees": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      },
      "esg": {
       "type": "number",
       "minimum": 0,
       "maximum": 1
      }
     }
    }
   }
  },
  "fees": {
   "type": "object",
   "description": "An object with the all the fees to be applied in the proposal",
   "properties": {
    "management": {
     "type": "object",
     "properties": {
      "value": {
       "type": [
        "number",
        "null"
       ]
      },
      "message": {
       "type": "string"
      }
     }
    },
    "success": {
     "type": "object",
     "properties": {
      "value": {
       "type": [
        "number",
        "null"
       ]
      },
      "message": {
       "type": "string"
      }
     }
    },
    "ocr": {
     "type": "object",
     "properties": {
      "value": {
       "type": [
        "number",
        "null"
       ]
      },
      "message": {
       "type": "string"
      }
     }
    },
    "other": {
     "type": "object",
     "properties": {
      "value": {
       "type": [
        "number",
        "null"
       ]
      },
      "message": {
       "type": "string"
      }
     }
    }
   }
  },
  "benchmarkIds": {
   "anyOf": [
    {
     "type": "array",
     "description": "Array of symbolIds",
     "items": {
      "type": "number",
      "minimum": 1
     }
    },
    {
     "type": "null"
    }
   ]
  },
  "associatedPortfolioId": {
   "anyOf": [
    {
     "type": "number",
     "minimum": 1
    },
    {
     "type": "null"
    }
   ]
  },
  "powerBars": {
   "type": "object",
   "description": "An object with parameters to use for the powerbars chart",
   "properties": {
    "profitability": {
     "type": "number"
    },
    "risk": {
     "type": "number"
    },
    "diversification": {
     "type": "number"
    },
    "cost": {
     "type": "number"
    }
   }
  },
  "regularFlows": {
   "type": "object",
   "description": "Create the proposal including information about regular inflows",
   "additionalProperties": false,
   "properties": {
    "amount": {
     "type": "number",
     "minimum": 0
    },
    "frequency": {
     "type": "string",
     "enum": [
      "W",
      "M",
      "Y"
     ]
    }
   }
  }
 },
 "additionalProperties": true,
 "oneOf": [
  {
   "required": [
    "proposal"
   ],
   "prohibited": [
    "proposalId",
    "positions",
    "strategyConfiguration"
   ]
  },
  {
   "required": [
    "proposalId"
   ],
   "prohibited": [
    "proposal",
    "positions",
    "strategyConfiguration"
   ]
  },
  {
   "required": [
    "positions",
    "strategyConfiguration"
   ],
   "prohibited": [
    "proposalId",
    "proposal"
   ]
  }
 ]
}

Events

  • changed

    Fired when the component loads with the status of the proposal

    Return

    • {string} status
  • generated

    Fired when te component loads if the proposal is generated

Locales

{}