Skip to content

Commit a6b8327

Browse files
committed
Updated
1 parent 3294de6 commit a6b8327

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/app/autopilot/autopilot.component.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export class AutopilotComponent implements OnInit, OnDestroy {
9999
strategyCounter = null;
100100

101101
strategyList = [
102-
Strategy.Swingtrade,
103102
Strategy.Daytrade,
103+
Strategy.Swingtrade,
104104
Strategy.InverseSwingtrade,
105105
Strategy.DaytradeShort,
106106
Strategy.Short
@@ -139,9 +139,11 @@ export class AutopilotComponent implements OnInit, OnDestroy {
139139
) { }
140140

141141
ngOnInit(): void {
142-
const lastStrategy = JSON.parse(sessionStorage.getItem('lastStrategy'));
143-
const lastStrategyCount = this.strategyList.findIndex(strat => strat === lastStrategy);
144-
this.strategyCounter = lastStrategyCount >= 0 ? lastStrategyCount : 0;
142+
const lastStrategy = JSON.parse(sessionStorage.getItem('profitLoss'));
143+
if (lastStrategy && lastStrategy.lastStrategy) {
144+
const lastStrategyCount = this.strategyList.findIndex(strat => strat === lastStrategy);
145+
this.strategyCounter = lastStrategyCount >= 0 ? lastStrategyCount : 0;
146+
}
145147
}
146148

147149
open() {

0 commit comments

Comments
 (0)