There was an error while loading. Please reload this page.
1 parent 539ef17 commit cb42264Copy full SHA for cb42264
src/trading/strategy/Strategy.js
@@ -77,6 +77,12 @@ class Strategy {
77
}
78
79
stocksCanBeBought(riskForOneStock, buyingPrice) {
80
+ this.logger("-------- Calculating Stocks to Buy ---------", {
81
+ risk: riskForOneStock,
82
+ price: buyingPrice,
83
+ capital: this.capital,
84
+ risk: this.risk,
85
+ });
86
const maxStocksByCapital = this.capital / buyingPrice;
87
const maxStocksByRisk = this.risk / riskForOneStock;
88
@@ -257,6 +263,7 @@ class Strategy {
257
263
async trade() {
258
264
this.logger("-------- Got A Quote, Resuming Strategy ---------");
259
265
266
+ this.updateCapital();
260
267
this.currentPosition && (await this.checkPosition());
261
268
262
269
if (this.currentPosition?.side === "Buy") {
0 commit comments