order_target_percent() should not be using
portfolio_value for the calculations, here is an example:
- initialize -
- handle - Time is 01:00. Run
- handle - Time is 02:00, Litecoin price went up by 10%. Run
portfolio_value is now 110 BTC, it will try buying more LTC.
However, there is no actual BTC to buy this extra LTC because the position is still open.
Instead of using
portfolio_value, it should use something that indicates how many BTC (or quote_currency) you currently have left.
What are your thoughts?