@showr/core
Version:
Core library for Showr
30 lines (29 loc) • 887 B
TypeScript
/**
* Creates a back-test report.
*/
export declare class BacktestReport {
_currentCapital: number;
profit: number;
loss: number;
numberOfTrades: number;
initialCapital: number;
finalCapital: number;
returns: number;
/**
* Defines the initial capital for the back-test.
* @param initialCapital - Initial capital for the back-test.
*/
constructor(initialCapital: number);
private updateCapital;
private updateTotals;
/**
* Updates the capital according to the traded value after executing the entry position.
* @param tradedValue - Traded value at the time.
*/
markEntry(tradedValue: number): void;
/**
* Updates the capital according to the traded value after executing the exit position.
* @param tradedValue - Traded value at the time.
*/
markExit(tradedValue: number): void;
}