Skip to content

Instantly share code, notes, and snippets.

@andrewkim316
Last active August 23, 2019 22:45
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 andrewkim316/0a7dfa497d9d8c17606452dd005593cf to your computer and use it in GitHub Desktop.
Save andrewkim316/0a7dfa497d9d8c17606452dd005593cf to your computer and use it in GitHub Desktop.
// Determine amount to long/short based on total stock price of each bucket.
var equity;
await this.alpaca.getAccount().then((resp) => {
equity = resp.equity;
}).catch((err) => {console.log(err.error);});
this.shortAmount = 0.30 * equity;
this.longAmount = Number(this.shortAmount) + Number(equity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment