Closed kylerberry closed 6 years ago
a future solution could be to once again change the time at which and how positionsize and totals are calculated.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
lib/TraderBot.js | 2 | 3 | 66.67% | ||
lib/PortfolioManager.js | 13 | 15 | 86.67% | ||
<!-- | Total: | 15 | 18 | 83.33% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
lib/PortfolioManager.js | 1 | 80.5% | ||
lib/TraderBot.js | 1 | 48.92% | ||
<!-- | Total: | 2 | --> |
Totals | |
---|---|
Change from base Build 42: | 2.2% |
Covered Lines: | 238 |
Relevant Lines: | 402 |
@ZurabWeb i think i'm going to close this and make a PR with a different solution. i kind of hate this one
going to give up on forcing the bot to sell 100% of a position before it can buy another
https://github.com/kylerberry/JACT/issues/29
no solution is really ideal. the first solution throws off a lot of zero checks and complicates total calculations. The second solution also complicates calculations and introduces the possibility to sell the remainder at a loss. Opted for if a position > 0 and < minimumSize for that product, set the order size to the minimumSize. This still makes calculations a little weak, but will force the bot to completely sell off a position (and then some) before moving on.