[Bug/Feature]: long-short.py - Qty should be calculated relative to price of stock #579
Open
1 task done
Labels
enhancement
New feature or request
Is there an existing issue for this?
Current Behavior
When opening new positions, the long-short.py opens all the positioning with approximately the same qty in terms of shares (ie: with 100k capital, each position is 160 shares). This does not make sense, the position should be calculated based on the price of the stock.
For example, the code tries to open a long position for AMZN for 160 shares (2.880$/each) and this goes way above the available liquidity. Likewise, it opens a position of 160 shares for GM (44.85$/each).
I've tried to fix the code but I'm not sure about all the references, so it'd be cool if someone from Alpaca could fix this.
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: