linting
This commit is contained in:
parent
597c6efc9b
commit
8b5e06954a
26 changed files with 532 additions and 186 deletions
|
|
@ -82,11 +82,17 @@ export class NotificationsComponent {
|
|||
const diff = now.getTime() - timestamp.getTime();
|
||||
const minutes = Math.floor(diff / 60000);
|
||||
|
||||
if (minutes < 1) {return 'Just now';}
|
||||
if (minutes < 60) {return `${minutes}m ago`;}
|
||||
if (minutes < 1) {
|
||||
return 'Just now';
|
||||
}
|
||||
if (minutes < 60) {
|
||||
return `${minutes}m ago`;
|
||||
}
|
||||
|
||||
const hours = Math.floor(minutes / 60);
|
||||
if (hours < 24) {return `${hours}h ago`;}
|
||||
if (hours < 24) {
|
||||
return `${hours}h ago`;
|
||||
}
|
||||
|
||||
const days = Math.floor(hours / 24);
|
||||
return `${days}d ago`;
|
||||
|
|
|
|||
|
|
@ -161,8 +161,12 @@ export class PortfolioComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
getPnLColor(value: number): string {
|
||||
if (value > 0) {return 'text-green-600';}
|
||||
if (value < 0) {return 'text-red-600';}
|
||||
if (value > 0) {
|
||||
return 'text-green-600';
|
||||
}
|
||||
if (value < 0) {
|
||||
return 'text-red-600';
|
||||
}
|
||||
return 'text-gray-600';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ export class DrawdownChartComponent implements OnChanges {
|
|||
}
|
||||
|
||||
private renderChart(): void {
|
||||
if (!this.chartElement || !this.backtestResult) {return;}
|
||||
if (!this.chartElement || !this.backtestResult) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up previous chart if it exists
|
||||
if (this.chart) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ export class EquityChartComponent implements OnChanges {
|
|||
}
|
||||
|
||||
private renderChart(): void {
|
||||
if (!this.chartElement || !this.backtestResult) {return;}
|
||||
if (!this.chartElement || !this.backtestResult) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clean up previous chart if it exists
|
||||
if (this.chart) {
|
||||
|
|
|
|||
|
|
@ -278,27 +278,45 @@ export class PerformanceMetricsComponent {
|
|||
|
||||
// Conditional classes
|
||||
getReturnClass(value: number): string {
|
||||
if (value > 0) {return 'positive';}
|
||||
if (value < 0) {return 'negative';}
|
||||
if (value > 0) {
|
||||
return 'positive';
|
||||
}
|
||||
if (value < 0) {
|
||||
return 'negative';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
getRatioClass(value: number): string {
|
||||
if (value >= 1.5) {return 'positive';}
|
||||
if (value >= 1) {return 'neutral';}
|
||||
if (value < 0) {return 'negative';}
|
||||
if (value >= 1.5) {
|
||||
return 'positive';
|
||||
}
|
||||
if (value >= 1) {
|
||||
return 'neutral';
|
||||
}
|
||||
if (value < 0) {
|
||||
return 'negative';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
getWinRateClass(value: number): string {
|
||||
if (value >= 0.55) {return 'positive';}
|
||||
if (value >= 0.45) {return 'neutral';}
|
||||
if (value >= 0.55) {
|
||||
return 'positive';
|
||||
}
|
||||
if (value >= 0.45) {
|
||||
return 'neutral';
|
||||
}
|
||||
return 'negative';
|
||||
}
|
||||
|
||||
getProfitFactorClass(value: number): string {
|
||||
if (value >= 1.5) {return 'positive';}
|
||||
if (value >= 1) {return 'neutral';}
|
||||
if (value >= 1.5) {
|
||||
return 'positive';
|
||||
}
|
||||
if (value >= 1) {
|
||||
return 'neutral';
|
||||
}
|
||||
return 'negative';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,9 @@ export class BacktestDialogComponent implements OnInit {
|
|||
}
|
||||
|
||||
addSymbol(symbol: string): void {
|
||||
if (!symbol || this.selectedSymbols.includes(symbol)) {return;}
|
||||
if (!symbol || this.selectedSymbols.includes(symbol)) {
|
||||
return;
|
||||
}
|
||||
this.selectedSymbols.push(symbol);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,9 @@ export class StrategyDialogComponent implements OnInit {
|
|||
}
|
||||
|
||||
addSymbol(symbol: string): void {
|
||||
if (!symbol || this.selectedSymbols.includes(symbol)) {return;}
|
||||
if (!symbol || this.selectedSymbols.includes(symbol)) {
|
||||
return;
|
||||
}
|
||||
this.selectedSymbols.push(symbol);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue