Skip to content

Commit cb42264

Browse files
committed
added extra logs to debug
1 parent 539ef17 commit cb42264

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/trading/strategy/Strategy.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ class Strategy {
7777
}
7878

7979
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+
});
8086
const maxStocksByCapital = this.capital / buyingPrice;
8187
const maxStocksByRisk = this.risk / riskForOneStock;
8288

@@ -257,6 +263,7 @@ class Strategy {
257263
async trade() {
258264
this.logger("-------- Got A Quote, Resuming Strategy ---------");
259265

266+
this.updateCapital();
260267
this.currentPosition && (await this.checkPosition());
261268

262269
if (this.currentPosition?.side === "Buy") {

0 commit comments

Comments
 (0)