/** * */ export declare class Event { private symbol?; private from_date?; private to_date?; private _timeframe?; private _historyBarCount?; private _historyTickCount?; selectSymbol(symbol_name: string): this; /** * @param from_date this date can be used by retrieving bar_history * @returns Event is returned for build data flow for bar_history */ fromDate(from_date: Date): this; /** * @param to_date this date can be used by retrieving bar_history * @returns Event is returned for build data flow for bar_history */ toDate(to_date: Date): this; /** * @param timeframe Needs when onBar is called * @returns Event is returned for build data flow for onBarEvent */ timeframe(timeframe: Timeframe): this; /** * * @param history_bar_count When onBar event called this amount of bars will send to onBar event callbacks */ historyBarCount(history_bar_count: number): this; /** * * @param history_tick_count when onTick event called this amount of ticks will send to onTick event callbacks */ historyTickCount(history_tick_count: number): this; /** * Convert Javascript date to Mql5 date * @param date JavaScript date */ private jsDateToMqlDate; /** * Get price history bars - requires * 1. symbol name * 2. timeframe * 3. from date * 4. to date */ getBars(): Promise; /** * onBar event called when a new bar is formed using your specified parameters - requires * 1. symbol name * 2. timeframe * 3. history bar count * @param on_bar_callback when a new bar is formed this callback will be called with amount of history bars you specified */ onBar(on_bar_callback: (bars: Bar[]) => void): this; /** * onTick event will called when a new tick is found - requires * 1. symbol name * 2. history tick count * @param on_tick_callback when a new tick is found this callback will be called with amount of tick history you specified */ onTick(on_tick_callback: (ticks: Tick[]) => void): this; /** * If onBar event is not needed anymore than unsubscribe it */ unsubscribeOnBarEvent(): void; /** * If onTick event is not needed anymore than unsubsribe it */ unsubscribeOnTickEvent(): void; } export declare enum Timeframe { M1 = "M1", M2 = "M2", M3 = "M3", M4 = "M4", M5 = "M5", M6 = "M6", M10 = "M10", M12 = "M12", M15 = "M15", M20 = "M20", M30 = "M30", H1 = "H1", H2 = "H2", H3 = "H3", H4 = "H4", H6 = "H6", H8 = "H8", H12 = "H12", D1 = "D1", W1 = "W1", MN1 = "MN1" } export interface Bar { time: string; open: number; high: number; low: number; close: number; volume: number; spread: number; } export interface Tick { ask: number; bid: number; flags: TickFlag; last: number; time: string; time_msc: number; volume: number; } export declare enum TickFlag { ASK = "ASK", BID = "BID", BUY = "BUY", SELL = "SELL", LAST = "LAST", VOLUME = "VOLUME", NONE = "NONE" }