Add ticker to the UserStrategies list and set debit credit to 1 for backtest
This commit is contained in:
@@ -554,6 +554,7 @@ public class DataController : ControllerBase
|
|||||||
Positions = positions,
|
Positions = positions,
|
||||||
Identifier = strategy.Identifier,
|
Identifier = strategy.Identifier,
|
||||||
WalletBalances = new Dictionary<DateTime, decimal>(),
|
WalletBalances = new Dictionary<DateTime, decimal>(),
|
||||||
|
Ticker = strategy.Ticker
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,5 +71,6 @@ namespace Managing.Api.Models.Responses
|
|||||||
public Guid Identifier { get; set; }
|
public Guid Identifier { get; set; }
|
||||||
|
|
||||||
public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new Dictionary<DateTime, decimal>();
|
public Dictionary<DateTime, decimal> WalletBalances { get; set; } = new Dictionary<DateTime, decimal>();
|
||||||
|
public Enums.Ticker Ticker { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ namespace Managing.Application.Backtests
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
creditRequestId = await _kaigenService.DebitUserCreditsAsync(user, 3);
|
creditRequestId = await _kaigenService.DebitUserCreditsAsync(user, 1);
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Successfully debited credits for user {UserName} with request ID {RequestId}",
|
"Successfully debited credits for user {UserName} with request ID {RequestId}",
|
||||||
user.Name, creditRequestId);
|
user.Name, creditRequestId);
|
||||||
|
|||||||
@@ -4502,6 +4502,7 @@ export interface UserStrategyDetailsViewModel {
|
|||||||
positions?: Position[] | null;
|
positions?: Position[] | null;
|
||||||
identifier?: string;
|
identifier?: string;
|
||||||
walletBalances?: { [key: string]: number; } | null;
|
walletBalances?: { [key: string]: number; } | null;
|
||||||
|
ticker?: Ticker;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlatformSummaryViewModel {
|
export interface PlatformSummaryViewModel {
|
||||||
|
|||||||
@@ -985,6 +985,7 @@ export interface UserStrategyDetailsViewModel {
|
|||||||
positions?: Position[] | null;
|
positions?: Position[] | null;
|
||||||
identifier?: string;
|
identifier?: string;
|
||||||
walletBalances?: { [key: string]: number; } | null;
|
walletBalances?: { [key: string]: number; } | null;
|
||||||
|
ticker?: Ticker;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PlatformSummaryViewModel {
|
export interface PlatformSummaryViewModel {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {Card, FormInput, GridTile} from '../../components/mollecules'
|
|||||||
import useApiUrlStore from '../../app/store/apiStore'
|
import useApiUrlStore from '../../app/store/apiStore'
|
||||||
import {
|
import {
|
||||||
type AgentBalanceHistory,
|
type AgentBalanceHistory,
|
||||||
|
BotStatus,
|
||||||
DataClient,
|
DataClient,
|
||||||
type Position,
|
type Position,
|
||||||
TradeDirection,
|
TradeDirection,
|
||||||
@@ -356,8 +357,9 @@ function AgentSearch({ index }: { index: number }) {
|
|||||||
{agentData?.strategies && agentData.strategies.length > 0 && (
|
{agentData?.strategies && agentData.strategies.length > 0 && (
|
||||||
<GridTile title="Strategies">
|
<GridTile title="Strategies">
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="grid grid-cols-6 gap-4 p-3 bg-base-300 rounded-lg text-sm font-medium">
|
<div className="grid grid-cols-7 gap-4 p-3 bg-base-300 rounded-lg text-sm font-medium">
|
||||||
<span>Name</span>
|
<span>Name</span>
|
||||||
|
<span>Ticker</span>
|
||||||
<span>Status</span>
|
<span>Status</span>
|
||||||
<span>PnL</span>
|
<span>PnL</span>
|
||||||
<span>ROI</span>
|
<span>ROI</span>
|
||||||
@@ -366,9 +368,10 @@ function AgentSearch({ index }: { index: number }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{agentData.strategies.map((strategy, index) => (
|
{agentData.strategies.map((strategy, index) => (
|
||||||
<div key={index} className="grid grid-cols-6 gap-4 p-3 bg-base-200 rounded-lg text-sm">
|
<div key={index} className="grid grid-cols-7 gap-4 p-3 bg-base-200 rounded-lg text-sm">
|
||||||
<span className="font-medium">{strategy.name}</span>
|
<span className="font-medium">{strategy.name}</span>
|
||||||
<span className={`badge ${strategy.state === 'RUNNING' ? 'badge-success' : 'badge-warning'}`}>
|
<span className="text-blue-500 font-medium">{strategy.ticker || '-'}</span>
|
||||||
|
<span className={`badge ${strategy.state == BotStatus.Running ? 'badge-success' : 'badge-warning'}`}>
|
||||||
{strategy.state}
|
{strategy.state}
|
||||||
</span>
|
</span>
|
||||||
<span className={strategy.pnL && strategy.pnL >= 0 ? 'text-green-500' : 'text-red-500'}>
|
<span className={strategy.pnL && strategy.pnL >= 0 ? 'text-green-500' : 'text-red-500'}>
|
||||||
|
|||||||
Reference in New Issue
Block a user