@stoqey/ibkr
Version:
NodeJS Interactive Brokers wrapper & utilities using @stoqey/ib
17 lines (16 loc) • 594 B
TypeScript
import { Position } from "../interfaces";
/**
* Get Profit percentage gained
* https://www.investopedia.com/ask/answers/how-do-you-calculate-percentage-gain-or-loss-investment/
* @param startPrice
* @param endPrice
*/
export declare const getPercentageGain: (startPrice: number, endPrice: number) => number;
/**
* GetTotalProfitAmount, from start and end
* @param start
* @param end
* @param capital
*/
export declare const getTotalProfitAmount: (start: number, end: number, capital: number, sell?: boolean) => number;
export declare const calculatePnl: (positions: Position[]) => number;