Skip to content

Commit 8c3f44d

Browse files
author
Sourav Das
committed
fix logging
1 parent ee202e2 commit 8c3f44d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/modules/trading-engine/strategy/MovingAverageStrategy.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ class MovingAverageStrategy extends Strategy {
6363

6464
if (!today || !yesterday) return;
6565
const ma20high_yesterday = yesterday.ma20high;
66-
this.logger.info("Long Square off check", { today, ma20high_yesterday });
6766
if (ma20high_yesterday > today.low && today.body < 0) {
6867
await this.updateStopLoss(ma20high_yesterday);
6968
}
@@ -73,7 +72,6 @@ class MovingAverageStrategy extends Strategy {
7372
const today = this.stock.now();
7473
const yesterday = this.stock.prev();
7574

76-
this.logger.info("Sell Condition Check", { today, yesterday });
7775
if (!today || !yesterday) return;
7876

7977
if (
@@ -103,7 +101,6 @@ class MovingAverageStrategy extends Strategy {
103101

104102
if (!today || !yesterday) return;
105103
const ma20low_yesterday = yesterday.ma20low;
106-
this.logger.info("Short Square off check", { today, ma20low_yesterday });
107104
if (today.high > ma20low_yesterday && today.body > 0) {
108105
await this.updateStopLoss(ma20low_yesterday);
109106
}

src/modules/trading-engine/strategy/Strategy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class Strategy extends BaseStrategy {
115115
this.currentPosition = this._positionManager.getCurrentPosition();
116116
this.currentPosition && (await this.checkPositionStatus());
117117

118+
if (this.currentPosition) {
119+
this.logger.info("Square off condition Check");
120+
}
118121
if (this.currentPosition?.side === "Buy") {
119122
await this.longSquareOff();
120123
return;

0 commit comments

Comments
 (0)