Skip to content

Instantly share code, notes, and snippets.

@lequant40
Last active May 25, 2022 10:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lequant40/beb975c28751fe849ed24d98568d90ec to your computer and use it in GitHub Desktop.
Save lequant40/beb975c28751fe849ed24d98568d90ec to your computer and use it in GitHub Desktop.
Hierarchical Clustering-based portfolio optimization algorithm
fetch('https://api.portfoliooptimizer.io/v1/portfolio/optimization/hierarchical-risk-parity/clustering-based',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ assets: 5,
assetsCovarianceMatrix: [[1,1,0,0,0],[1,1,0,0,0],[0,0,1,0,0],[0,0,0,1,1],[0,0,0,1,1]],
clusters: 3,
acrossClusterAllocationMethod: "equalWeighting",
withinClusterAllocationMethod: "equalWeighting",
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment