@fraserdarwent/xapi-node
Version:
This project is made possible to get data from Forex market, execute market or limit order with NodeJS/JS through WebSocket connection
35 lines (34 loc) • 1.39 kB
TypeScript
import { TradePosition, Transaction } from '../interface/Interface';
import { CMD_FIELD, STREAMING_TRADE_RECORD, TRADE_RECORD } from '..';
import { PositionType } from '../enum/Enum';
export declare class Utils {
static hideSecretInfo(transaction: Transaction<any, any>): Transaction<any, any>;
static parseCustomTag(customTag: string | null): {
transactionId: string | null;
command: string | null;
};
static getObjectChanges(from: TradePosition, to: TradePosition): any;
static formatPosition(t: STREAMING_TRADE_RECORD | TRADE_RECORD): TradePosition;
static transactionToJSONString(transaction: Transaction<any, any>): string;
static getUTCTimestampString(): string;
static formatNumber(number: number, length: number): string;
static getPositionType({ cmd, closed, close_time }: {
cmd: CMD_FIELD;
closed: boolean;
close_time: number;
}): PositionType;
static getContractValue({ price, lot, contractSize, currency, currencyProfit }: {
price: number;
lot: number;
contractSize: number;
currency: string;
currencyProfit: string;
}): number;
static getProfit({ openPrice, closePrice, isBuy, lot, contractSize }: {
openPrice: number;
closePrice: number;
isBuy: boolean;
lot: number;
contractSize: number;
}): number;
}