This commit is contained in:
Boki 2025-06-11 10:38:05 -04:00
parent 9d38f9a7b6
commit eeae192872
26 changed files with 532 additions and 186 deletions

View file

@ -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`;

View file

@ -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';
}
}

View file

@ -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) {

View file

@ -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) {

View file

@ -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';
}
}

View file

@ -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);
}

View file

@ -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);
}