@danielgroen/dxtrade-api 1.0.20 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,17 +21,18 @@ npm install dxtrade-api
21
21
 
22
22
  - [x] Authentication & session management
23
23
  - [x] Submit orders (market, limit, stop)
24
- - [x] Positions (get & close)
25
- - [x] Account metrics & trade journal
24
+ - [x] Get & cancel orders
25
+ - [x] Positions (get, close, close all)
26
+ - [x] Position metrics (per-position P&L)
27
+ - [x] Account metrics, trade journal & trade history
26
28
  - [x] Symbol search & instrument info
29
+ - [x] OHLC / price bar data
27
30
  - [x] PnL assessments
28
31
  - [x] Multi-broker support (FTMO, Eightcap, Lark Funding)
29
32
  - [x] Full TypeScript support
30
33
  - [ ] Batch orders
31
- - [ ] Close whole position helper
32
34
  - [ ] Modify existing orders
33
35
  - [ ] Real-time price streaming
34
- - [ ] Order history
35
36
 
36
37
  ## Quick Start
37
38
 
@@ -99,20 +100,27 @@ BROKER.FTMO // "https://dxtrade.ftmo.com"
99
100
  - `client.getSymbolInfo(symbol)` — Get instrument info (volume limits, lot size)
100
101
  - `client.getSymbolLimits()` — Get order size limits and stop/limit distances for all symbols
101
102
  - `client.getInstruments(params?)` — Get all available instruments, optionally filtered by partial match (e.g. `{ type: "FOREX" }`)
103
+ - `client.getOHLC(params)` — Fetch OHLC price bars for a symbol (resolution, range, maxBars, priceField)
102
104
 
103
105
  ### Trading
104
106
 
105
107
  - `client.submitOrder(params)` — Submit an order and wait for WebSocket confirmation
108
+ - `client.getOrders()` — Get all pending/open orders via WebSocket
109
+ - `client.cancelOrder(orderChainId)` — Cancel a single pending order
110
+ - `client.cancelAllOrders()` — Cancel all pending orders
106
111
 
107
112
  ### Positions
108
113
 
109
114
  - `client.getPositions()` — Get all open positions via WebSocket
110
- - `client.closePosition(params)` — Close a position
115
+ - `client.closePosition(params)` — Close a position (supports partial closes via the quantity field)
116
+ - `client.closeAllPositions()` — Close all open positions with market orders
117
+ - `client.getPositionMetrics()` — Get position-level P&L metrics via WebSocket
111
118
 
112
119
  ### Account
113
120
 
114
121
  - `client.getAccountMetrics()` — Get account metrics (equity, balance, margin, open P&L, etc.)
115
122
  - `client.getTradeJournal({ from, to })` — Fetch trade journal entries for a date range (Unix timestamps)
123
+ - `client.getTradeHistory({ from, to })` — Fetch trade history for a date range (Unix timestamps)
116
124
 
117
125
  ### Analytics
118
126
 
@@ -150,16 +158,21 @@ const client = new DxtradeClient({
150
158
  cp .env.example .env # fill in credentials
151
159
  npm run example:connect
152
160
  npm run example:order
161
+ npm run example:orders
153
162
  npm run example:positions
154
163
  npm run example:close-position
164
+ npm run example:close-all-positions
165
+ npm run example:position-metrics
155
166
  npm run example:assessments
156
167
  npm run example:assessments:btc
157
168
  npm run example:account
158
169
  npm run example:instruments
170
+ npm run example:ohlc
159
171
  npm run example:instruments:forex
160
172
  npm run example:symbol
161
173
  npm run example:symbol:btc
162
174
  npm run example:trade-journal
175
+ npm run example:trade-history
163
176
  npm run example:debug
164
177
  ```
165
178
 
package/dist/index.d.mts CHANGED
@@ -11,12 +11,19 @@ declare const endpoints: {
11
11
  instrumentInfo: (base: string, symbol: string, tzOffset: number) => string;
12
12
  submitOrder: (base: string) => string;
13
13
  closePosition: (base: string) => string;
14
+ cancelOrder: (base: string, accountId: string, orderChainId: number) => string;
14
15
  assessments: (base: string) => string;
15
- websocket: (base: string) => string;
16
+ websocket: (base: string, atmosphereId?: string | null) => string;
16
17
  tradeJournal: (base: string, params: {
17
18
  from: number;
18
19
  to: number;
19
20
  }) => string;
21
+ tradeHistory: (base: string, params: {
22
+ from: number;
23
+ to: number;
24
+ }) => string;
25
+ subscribeInstruments: (base: string) => string;
26
+ charts: (base: string) => string;
20
27
  };
21
28
 
22
29
  declare enum ORDER_TYPE {
@@ -37,20 +44,60 @@ declare enum TIF {
37
44
  DAY = "DAY",
38
45
  GTD = "GTD"
39
46
  }
47
+ declare enum ERROR {
48
+ NO_SESSION = "NO_SESSION",
49
+ LOGIN_FAILED = "LOGIN_FAILED",
50
+ LOGIN_ERROR = "LOGIN_ERROR",
51
+ CSRF_NOT_FOUND = "CSRF_NOT_FOUND",
52
+ CSRF_ERROR = "CSRF_ERROR",
53
+ ACCOUNT_SWITCH_ERROR = "ACCOUNT_SWITCH_ERROR",
54
+ NO_SUGGESTIONS = "NO_SUGGESTIONS",
55
+ SUGGEST_ERROR = "SUGGEST_ERROR",
56
+ NO_SYMBOL_INFO = "NO_SYMBOL_INFO",
57
+ SYMBOL_INFO_ERROR = "SYMBOL_INFO_ERROR",
58
+ INSTRUMENTS_TIMEOUT = "INSTRUMENTS_TIMEOUT",
59
+ INSTRUMENTS_ERROR = "INSTRUMENTS_ERROR",
60
+ LIMITS_TIMEOUT = "LIMITS_TIMEOUT",
61
+ LIMITS_ERROR = "LIMITS_ERROR",
62
+ OHLC_TIMEOUT = "OHLC_TIMEOUT",
63
+ OHLC_ERROR = "OHLC_ERROR",
64
+ ORDER_ERROR = "ORDER_ERROR",
65
+ ORDERS_TIMEOUT = "ORDERS_TIMEOUT",
66
+ ORDERS_ERROR = "ORDERS_ERROR",
67
+ CANCEL_ORDER_ERROR = "CANCEL_ORDER_ERROR",
68
+ POSITION_CLOSE_ERROR = "POSITION_CLOSE_ERROR",
69
+ POSITION_METRICS_TIMEOUT = "POSITION_METRICS_TIMEOUT",
70
+ POSITION_METRICS_ERROR = "POSITION_METRICS_ERROR",
71
+ ACCOUNT_METRICS_TIMEOUT = "ACCOUNT_METRICS_TIMEOUT",
72
+ ACCOUNT_METRICS_ERROR = "ACCOUNT_METRICS_ERROR",
73
+ ACCOUNT_POSITIONS_TIMEOUT = "ACCOUNT_POSITIONS_TIMEOUT",
74
+ ACCOUNT_POSITIONS_ERROR = "ACCOUNT_POSITIONS_ERROR",
75
+ TRADE_JOURNAL_ERROR = "TRADE_JOURNAL_ERROR",
76
+ TRADE_HISTORY_ERROR = "TRADE_HISTORY_ERROR",
77
+ ASSESSMENTS_ERROR = "ASSESSMENTS_ERROR"
78
+ }
40
79
  declare enum WS_MESSAGE {
41
80
  ACCOUNT_METRICS = "ACCOUNT_METRICS",
42
81
  ACCOUNTS = "ACCOUNTS",
43
82
  AVAILABLE_WATCHLISTS = "AVAILABLE_WATCHLISTS",
83
+ CHART_FEED_SUBTOPIC = "chartFeedSubtopic",
44
84
  INSTRUMENTS = "INSTRUMENTS",
45
85
  LIMITS = "LIMITS",
46
86
  MESSAGE = "MESSAGE",
47
87
  ORDERS = "ORDERS",
48
88
  POSITIONS = "POSITIONS",
89
+ POSITION_METRICS = "POSITION_METRICS",
49
90
  POSITION_CASH_TRANSFERS = "POSITION_CASH_TRANSFERS",
50
91
  PRIVATE_LAYOUT_NAMES = "PRIVATE_LAYOUT_NAMES",
51
92
  SHARED_PROPERTIES_MESSAGE = "SHARED_PROPERTIES_MESSAGE",
93
+ TRADE_STATUSES = "TRADE_STATUSES",
52
94
  USER_LOGIN_INFO = "USER_LOGIN_INFO"
53
95
  }
96
+ declare namespace WS_MESSAGE {
97
+ enum SUBTOPIC {
98
+ BIG_CHART_COMPONENT = "BigChartComponentPresenter-4"
99
+ }
100
+ }
54
101
 
55
102
  declare class DxtradeError extends Error {
56
103
  code: string;
@@ -58,6 +105,22 @@ declare class DxtradeError extends Error {
58
105
  }
59
106
 
60
107
  declare namespace Order {
108
+ interface Get {
109
+ account: string;
110
+ orderId: number;
111
+ orderCode: string;
112
+ version: number;
113
+ type: ORDER_TYPE;
114
+ instrument: string;
115
+ status: string;
116
+ finalStatus: boolean;
117
+ side: SIDE;
118
+ tif: TIF;
119
+ legs: Leg[];
120
+ issueTime: string;
121
+ transactionTime: string;
122
+ [key: string]: unknown;
123
+ }
61
124
  interface SubmitParams {
62
125
  symbol: string;
63
126
  side: SIDE;
@@ -171,6 +234,20 @@ interface WsPayload {
171
234
  }
172
235
 
173
236
  declare namespace Account {
237
+ interface TradeHistory {
238
+ orderId: number;
239
+ orderCode: string;
240
+ instrument: string;
241
+ side: string;
242
+ type: string;
243
+ status: string;
244
+ quantity: number;
245
+ filledQuantity: number;
246
+ price: number;
247
+ averagePrice: number;
248
+ time: string;
249
+ [key: string]: unknown;
250
+ }
174
251
  interface Metrics {
175
252
  availableFunds: number;
176
253
  marginCallLevel: number | string;
@@ -238,6 +315,31 @@ declare namespace Instrument {
238
315
  }
239
316
  }
240
317
 
318
+ declare namespace OHLC {
319
+ interface Params {
320
+ /** Symbol to fetch bars for (e.g. "EURUSD"). */
321
+ symbol: string;
322
+ /** Bar aggregation period in seconds (default: 60 = 1 min). Common values: 60 (1m), 300 (5m), 900 (15m), 1800 (30m), 3600 (1h), 14400 (4h), 86400 (1d). */
323
+ resolution?: number;
324
+ /** Lookback window in seconds from now (default: 432000 = 5 days). Determines how far back in history to fetch bars. */
325
+ range?: number;
326
+ /** Maximum number of bars to return (default: 3500). */
327
+ maxBars?: number;
328
+ /** Price field to use (default: "bid"). */
329
+ priceField?: "bid" | "ask";
330
+ }
331
+ interface Bar {
332
+ timestamp: number;
333
+ open: number;
334
+ high: number;
335
+ low: number;
336
+ close: number;
337
+ volume: number;
338
+ vwap: number;
339
+ time: number;
340
+ }
341
+ }
342
+
241
343
  declare namespace Position {
242
344
  interface Get {
243
345
  uid: string;
@@ -257,6 +359,14 @@ declare namespace Position {
257
359
  takeProfit: number | null;
258
360
  stopLoss: number | null;
259
361
  }
362
+ interface Metrics {
363
+ positionCode: string;
364
+ openPl: number;
365
+ openPlPerLot: number;
366
+ currentPrice: number;
367
+ convertedOpenPl: number;
368
+ [key: string]: unknown;
369
+ }
260
370
  interface Close {
261
371
  legs: {
262
372
  instrumentId: number;
@@ -337,12 +447,24 @@ declare class DxtradeClient {
337
447
  * Supports market, limit, and stop orders with optional stop loss and take profit.
338
448
  */
339
449
  submitOrder(params: Order.SubmitParams): Promise<Order.Update>;
450
+ /** Get all pending/open orders via WebSocket. */
451
+ getOrders(): Promise<Order.Get[]>;
452
+ /** Cancel a single pending order by its order chain ID. */
453
+ cancelOrder(orderChainId: number): Promise<void>;
454
+ /** Cancel all pending orders. */
455
+ cancelAllOrders(): Promise<void>;
340
456
  /** Get account metrics including equity, balance, margin, and open P&L. */
341
457
  getAccountMetrics(): Promise<Account.Metrics>;
342
458
  /** Get all open positions via WebSocket. */
343
459
  getPositions(): Promise<Position.Get[]>;
344
- /** Close a position. */
460
+ /**
461
+ * Close a position. Supports partial closes by specifying a quantity smaller than the full position size.
462
+ */
345
463
  closePosition(position: Position.Close): Promise<void>;
464
+ /** Close all open positions with market orders. */
465
+ closeAllPositions(): Promise<void>;
466
+ /** Get position-level P&L metrics via WebSocket. */
467
+ getPositionMetrics(): Promise<Position.Metrics[]>;
346
468
  /**
347
469
  * Fetch trade journal entries for a date range.
348
470
  * @param params.from - Start timestamp (Unix ms)
@@ -352,10 +474,28 @@ declare class DxtradeClient {
352
474
  from: number;
353
475
  to: number;
354
476
  }): Promise<any>;
477
+ /**
478
+ * Fetch trade history for a date range.
479
+ * @param params.from - Start timestamp (Unix ms)
480
+ * @param params.to - End timestamp (Unix ms)
481
+ */
482
+ getTradeHistory(params: {
483
+ from: number;
484
+ to: number;
485
+ }): Promise<Account.TradeHistory[]>;
355
486
  /** Get all available instruments, optionally filtered by partial match (e.g. `{ type: "FOREX" }`). */
356
487
  getInstruments(params?: Partial<Instrument.Info>): Promise<Instrument.Info[]>;
357
488
  /** Fetch PnL assessments for an instrument within a date range. */
358
489
  getAssessments(params: Assessments.Params): Promise<Assessments.Response>;
490
+ /**
491
+ * Fetch OHLC price bars for a symbol.
492
+ * @param params.symbol - Instrument symbol (e.g. "EURUSD")
493
+ * @param params.resolution - Bar period in seconds (default: 60 = 1 min)
494
+ * @param params.range - Lookback window in seconds (default: 432000 = 5 days)
495
+ * @param params.maxBars - Maximum bars to return (default: 3500)
496
+ * @param params.priceField - "bid" or "ask" (default: "bid")
497
+ */
498
+ getOHLC(params: OHLC.Params): Promise<OHLC.Bar[]>;
359
499
  }
360
500
 
361
- export { ACTION, BROKER, type DxtradeCallbacks, DxtradeClient, type DxtradeConfig, DxtradeError, ORDER_TYPE, SIDE, TIF, WS_MESSAGE, type WsPayload, endpoints };
501
+ export { ACTION, BROKER, type DxtradeCallbacks, DxtradeClient, type DxtradeConfig, DxtradeError, ERROR, ORDER_TYPE, SIDE, TIF, WS_MESSAGE, type WsPayload, endpoints };
package/dist/index.d.ts CHANGED
@@ -11,12 +11,19 @@ declare const endpoints: {
11
11
  instrumentInfo: (base: string, symbol: string, tzOffset: number) => string;
12
12
  submitOrder: (base: string) => string;
13
13
  closePosition: (base: string) => string;
14
+ cancelOrder: (base: string, accountId: string, orderChainId: number) => string;
14
15
  assessments: (base: string) => string;
15
- websocket: (base: string) => string;
16
+ websocket: (base: string, atmosphereId?: string | null) => string;
16
17
  tradeJournal: (base: string, params: {
17
18
  from: number;
18
19
  to: number;
19
20
  }) => string;
21
+ tradeHistory: (base: string, params: {
22
+ from: number;
23
+ to: number;
24
+ }) => string;
25
+ subscribeInstruments: (base: string) => string;
26
+ charts: (base: string) => string;
20
27
  };
21
28
 
22
29
  declare enum ORDER_TYPE {
@@ -37,20 +44,60 @@ declare enum TIF {
37
44
  DAY = "DAY",
38
45
  GTD = "GTD"
39
46
  }
47
+ declare enum ERROR {
48
+ NO_SESSION = "NO_SESSION",
49
+ LOGIN_FAILED = "LOGIN_FAILED",
50
+ LOGIN_ERROR = "LOGIN_ERROR",
51
+ CSRF_NOT_FOUND = "CSRF_NOT_FOUND",
52
+ CSRF_ERROR = "CSRF_ERROR",
53
+ ACCOUNT_SWITCH_ERROR = "ACCOUNT_SWITCH_ERROR",
54
+ NO_SUGGESTIONS = "NO_SUGGESTIONS",
55
+ SUGGEST_ERROR = "SUGGEST_ERROR",
56
+ NO_SYMBOL_INFO = "NO_SYMBOL_INFO",
57
+ SYMBOL_INFO_ERROR = "SYMBOL_INFO_ERROR",
58
+ INSTRUMENTS_TIMEOUT = "INSTRUMENTS_TIMEOUT",
59
+ INSTRUMENTS_ERROR = "INSTRUMENTS_ERROR",
60
+ LIMITS_TIMEOUT = "LIMITS_TIMEOUT",
61
+ LIMITS_ERROR = "LIMITS_ERROR",
62
+ OHLC_TIMEOUT = "OHLC_TIMEOUT",
63
+ OHLC_ERROR = "OHLC_ERROR",
64
+ ORDER_ERROR = "ORDER_ERROR",
65
+ ORDERS_TIMEOUT = "ORDERS_TIMEOUT",
66
+ ORDERS_ERROR = "ORDERS_ERROR",
67
+ CANCEL_ORDER_ERROR = "CANCEL_ORDER_ERROR",
68
+ POSITION_CLOSE_ERROR = "POSITION_CLOSE_ERROR",
69
+ POSITION_METRICS_TIMEOUT = "POSITION_METRICS_TIMEOUT",
70
+ POSITION_METRICS_ERROR = "POSITION_METRICS_ERROR",
71
+ ACCOUNT_METRICS_TIMEOUT = "ACCOUNT_METRICS_TIMEOUT",
72
+ ACCOUNT_METRICS_ERROR = "ACCOUNT_METRICS_ERROR",
73
+ ACCOUNT_POSITIONS_TIMEOUT = "ACCOUNT_POSITIONS_TIMEOUT",
74
+ ACCOUNT_POSITIONS_ERROR = "ACCOUNT_POSITIONS_ERROR",
75
+ TRADE_JOURNAL_ERROR = "TRADE_JOURNAL_ERROR",
76
+ TRADE_HISTORY_ERROR = "TRADE_HISTORY_ERROR",
77
+ ASSESSMENTS_ERROR = "ASSESSMENTS_ERROR"
78
+ }
40
79
  declare enum WS_MESSAGE {
41
80
  ACCOUNT_METRICS = "ACCOUNT_METRICS",
42
81
  ACCOUNTS = "ACCOUNTS",
43
82
  AVAILABLE_WATCHLISTS = "AVAILABLE_WATCHLISTS",
83
+ CHART_FEED_SUBTOPIC = "chartFeedSubtopic",
44
84
  INSTRUMENTS = "INSTRUMENTS",
45
85
  LIMITS = "LIMITS",
46
86
  MESSAGE = "MESSAGE",
47
87
  ORDERS = "ORDERS",
48
88
  POSITIONS = "POSITIONS",
89
+ POSITION_METRICS = "POSITION_METRICS",
49
90
  POSITION_CASH_TRANSFERS = "POSITION_CASH_TRANSFERS",
50
91
  PRIVATE_LAYOUT_NAMES = "PRIVATE_LAYOUT_NAMES",
51
92
  SHARED_PROPERTIES_MESSAGE = "SHARED_PROPERTIES_MESSAGE",
93
+ TRADE_STATUSES = "TRADE_STATUSES",
52
94
  USER_LOGIN_INFO = "USER_LOGIN_INFO"
53
95
  }
96
+ declare namespace WS_MESSAGE {
97
+ enum SUBTOPIC {
98
+ BIG_CHART_COMPONENT = "BigChartComponentPresenter-4"
99
+ }
100
+ }
54
101
 
55
102
  declare class DxtradeError extends Error {
56
103
  code: string;
@@ -58,6 +105,22 @@ declare class DxtradeError extends Error {
58
105
  }
59
106
 
60
107
  declare namespace Order {
108
+ interface Get {
109
+ account: string;
110
+ orderId: number;
111
+ orderCode: string;
112
+ version: number;
113
+ type: ORDER_TYPE;
114
+ instrument: string;
115
+ status: string;
116
+ finalStatus: boolean;
117
+ side: SIDE;
118
+ tif: TIF;
119
+ legs: Leg[];
120
+ issueTime: string;
121
+ transactionTime: string;
122
+ [key: string]: unknown;
123
+ }
61
124
  interface SubmitParams {
62
125
  symbol: string;
63
126
  side: SIDE;
@@ -171,6 +234,20 @@ interface WsPayload {
171
234
  }
172
235
 
173
236
  declare namespace Account {
237
+ interface TradeHistory {
238
+ orderId: number;
239
+ orderCode: string;
240
+ instrument: string;
241
+ side: string;
242
+ type: string;
243
+ status: string;
244
+ quantity: number;
245
+ filledQuantity: number;
246
+ price: number;
247
+ averagePrice: number;
248
+ time: string;
249
+ [key: string]: unknown;
250
+ }
174
251
  interface Metrics {
175
252
  availableFunds: number;
176
253
  marginCallLevel: number | string;
@@ -238,6 +315,31 @@ declare namespace Instrument {
238
315
  }
239
316
  }
240
317
 
318
+ declare namespace OHLC {
319
+ interface Params {
320
+ /** Symbol to fetch bars for (e.g. "EURUSD"). */
321
+ symbol: string;
322
+ /** Bar aggregation period in seconds (default: 60 = 1 min). Common values: 60 (1m), 300 (5m), 900 (15m), 1800 (30m), 3600 (1h), 14400 (4h), 86400 (1d). */
323
+ resolution?: number;
324
+ /** Lookback window in seconds from now (default: 432000 = 5 days). Determines how far back in history to fetch bars. */
325
+ range?: number;
326
+ /** Maximum number of bars to return (default: 3500). */
327
+ maxBars?: number;
328
+ /** Price field to use (default: "bid"). */
329
+ priceField?: "bid" | "ask";
330
+ }
331
+ interface Bar {
332
+ timestamp: number;
333
+ open: number;
334
+ high: number;
335
+ low: number;
336
+ close: number;
337
+ volume: number;
338
+ vwap: number;
339
+ time: number;
340
+ }
341
+ }
342
+
241
343
  declare namespace Position {
242
344
  interface Get {
243
345
  uid: string;
@@ -257,6 +359,14 @@ declare namespace Position {
257
359
  takeProfit: number | null;
258
360
  stopLoss: number | null;
259
361
  }
362
+ interface Metrics {
363
+ positionCode: string;
364
+ openPl: number;
365
+ openPlPerLot: number;
366
+ currentPrice: number;
367
+ convertedOpenPl: number;
368
+ [key: string]: unknown;
369
+ }
260
370
  interface Close {
261
371
  legs: {
262
372
  instrumentId: number;
@@ -337,12 +447,24 @@ declare class DxtradeClient {
337
447
  * Supports market, limit, and stop orders with optional stop loss and take profit.
338
448
  */
339
449
  submitOrder(params: Order.SubmitParams): Promise<Order.Update>;
450
+ /** Get all pending/open orders via WebSocket. */
451
+ getOrders(): Promise<Order.Get[]>;
452
+ /** Cancel a single pending order by its order chain ID. */
453
+ cancelOrder(orderChainId: number): Promise<void>;
454
+ /** Cancel all pending orders. */
455
+ cancelAllOrders(): Promise<void>;
340
456
  /** Get account metrics including equity, balance, margin, and open P&L. */
341
457
  getAccountMetrics(): Promise<Account.Metrics>;
342
458
  /** Get all open positions via WebSocket. */
343
459
  getPositions(): Promise<Position.Get[]>;
344
- /** Close a position. */
460
+ /**
461
+ * Close a position. Supports partial closes by specifying a quantity smaller than the full position size.
462
+ */
345
463
  closePosition(position: Position.Close): Promise<void>;
464
+ /** Close all open positions with market orders. */
465
+ closeAllPositions(): Promise<void>;
466
+ /** Get position-level P&L metrics via WebSocket. */
467
+ getPositionMetrics(): Promise<Position.Metrics[]>;
346
468
  /**
347
469
  * Fetch trade journal entries for a date range.
348
470
  * @param params.from - Start timestamp (Unix ms)
@@ -352,10 +474,28 @@ declare class DxtradeClient {
352
474
  from: number;
353
475
  to: number;
354
476
  }): Promise<any>;
477
+ /**
478
+ * Fetch trade history for a date range.
479
+ * @param params.from - Start timestamp (Unix ms)
480
+ * @param params.to - End timestamp (Unix ms)
481
+ */
482
+ getTradeHistory(params: {
483
+ from: number;
484
+ to: number;
485
+ }): Promise<Account.TradeHistory[]>;
355
486
  /** Get all available instruments, optionally filtered by partial match (e.g. `{ type: "FOREX" }`). */
356
487
  getInstruments(params?: Partial<Instrument.Info>): Promise<Instrument.Info[]>;
357
488
  /** Fetch PnL assessments for an instrument within a date range. */
358
489
  getAssessments(params: Assessments.Params): Promise<Assessments.Response>;
490
+ /**
491
+ * Fetch OHLC price bars for a symbol.
492
+ * @param params.symbol - Instrument symbol (e.g. "EURUSD")
493
+ * @param params.resolution - Bar period in seconds (default: 60 = 1 min)
494
+ * @param params.range - Lookback window in seconds (default: 432000 = 5 days)
495
+ * @param params.maxBars - Maximum bars to return (default: 3500)
496
+ * @param params.priceField - "bid" or "ask" (default: "bid")
497
+ */
498
+ getOHLC(params: OHLC.Params): Promise<OHLC.Bar[]>;
359
499
  }
360
500
 
361
- export { ACTION, BROKER, type DxtradeCallbacks, DxtradeClient, type DxtradeConfig, DxtradeError, ORDER_TYPE, SIDE, TIF, WS_MESSAGE, type WsPayload, endpoints };
501
+ export { ACTION, BROKER, type DxtradeCallbacks, DxtradeClient, type DxtradeConfig, DxtradeError, ERROR, ORDER_TYPE, SIDE, TIF, WS_MESSAGE, type WsPayload, endpoints };