import { Broker } from './broker'; import { Trade } from './trade'; import { OrderOptions } from './interfaces'; export declare class Order { private readonly broker; private _size; private _limitPrice?; private _stopPrice?; private _slPrice?; private _tpPrice?; private _parentTrade?; private _tag?; constructor(broker: Broker, options: OrderOptions); /** * Order size (negative for short orders). * * If size is a value between 0 and 1, it is interpreted as a fraction of current * available liquidity (cash plus `Position.pl` minus used margin). * A value greater than or equal to 1 indicates an absolute number of units. */ get size(): number; /** * Order limit price for [limit orders], or `undefined` for [market orders], * which are filled at next available price. * * [limit orders]: https://www.investopedia.com/terms/l/limitorder.asp * [market orders]: https://www.investopedia.com/terms/m/marketorder.asp */ get limit(): number | undefined; /** * Order stop price for [stop-limit/stop-market][_] order, * otherwise `undefined` if no stop was set, or the stop price has already been hit. * * [_]: https://www.investopedia.com/terms/s/stoporder.asp */ get stop(): number | undefined; /** * A stop-loss price at which, if set, a new contingent stop-market order * will be placed upon the `Trade` following this order's execution. */ get sl(): number | undefined; /** * A take-profit price at which, if set, a new contingent limit order * will be placed upon the `Trade` following this order's execution. */ get tp(): number | undefined; get parentTrade(): Trade | undefined; /** * Arbitrary value (such as a string) which, if set, enables tracking * of this order and the associated `Trade`. */ get tag(): Record | undefined; /** * True if the order is long (order size is positive). */ get isLong(): boolean; /** * True if the order is short (order size is negative). */ get isShort(): boolean; /** * True for [contingent] orders, i.e. [OCO] stop-loss and take-profit bracket orders * placed upon an active trade. Remaining contingent orders are canceled when * their parent `Trade` is closed. * * [contingent]: https://www.investopedia.com/terms/c/contingentorder.asp * [OCO]: https://www.investopedia.com/terms/o/oco.asp */ get isContingent(): boolean; /** * Cancel the order. */ cancel(): void; /** * Replace the order. */ replace(options: Partial): this; }