Add best agent by pnl
This commit is contained in:
@@ -1939,6 +1939,41 @@ export class DataClient extends AuthorizedApiBase {
|
||||
return Promise.resolve<TopStrategiesByRoiViewModel>(null as any);
|
||||
}
|
||||
|
||||
data_GetTopAgentsByPnL(): Promise<TopAgentsByPnLViewModel> {
|
||||
let url_ = this.baseUrl + "/Data/GetTopAgentsByPnL";
|
||||
url_ = url_.replace(/[?&]$/, "");
|
||||
|
||||
let options_: RequestInit = {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
};
|
||||
|
||||
return this.transformOptions(options_).then(transformedOptions_ => {
|
||||
return this.http.fetch(url_, transformedOptions_);
|
||||
}).then((_response: Response) => {
|
||||
return this.processData_GetTopAgentsByPnL(_response);
|
||||
});
|
||||
}
|
||||
|
||||
protected processData_GetTopAgentsByPnL(response: Response): Promise<TopAgentsByPnLViewModel> {
|
||||
const status = response.status;
|
||||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
|
||||
if (status === 200) {
|
||||
return response.text().then((_responseText) => {
|
||||
let result200: any = null;
|
||||
result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as TopAgentsByPnLViewModel;
|
||||
return result200;
|
||||
});
|
||||
} else if (status !== 200 && status !== 204) {
|
||||
return response.text().then((_responseText) => {
|
||||
return throwException("An unexpected server error occurred.", status, _responseText, _headers);
|
||||
});
|
||||
}
|
||||
return Promise.resolve<TopAgentsByPnLViewModel>(null as any);
|
||||
}
|
||||
|
||||
data_GetUserStrategies(agentName: string | null | undefined): Promise<UserStrategyDetailsViewModel[]> {
|
||||
let url_ = this.baseUrl + "/Data/GetUserStrategies?";
|
||||
if (agentName !== undefined && agentName !== null)
|
||||
@@ -4602,6 +4637,19 @@ export interface StrategyRoiPerformance {
|
||||
volume?: number;
|
||||
}
|
||||
|
||||
export interface TopAgentsByPnLViewModel {
|
||||
topAgentsByPnL?: AgentPerformance[] | null;
|
||||
}
|
||||
|
||||
export interface AgentPerformance {
|
||||
agentName?: string | null;
|
||||
pnL?: number;
|
||||
totalROI?: number;
|
||||
totalVolume?: number;
|
||||
activeStrategiesCount?: number;
|
||||
totalBalance?: number;
|
||||
}
|
||||
|
||||
export interface UserStrategyDetailsViewModel {
|
||||
name?: string | null;
|
||||
state?: BotStatus;
|
||||
|
||||
Reference in New Issue
Block a user