Content - xStoredevelopers.xstore.pro/public/files/Changelog_2_3.pdf3 xStore ul. Ogrodowa 58, 00-876...
Transcript of Content - xStoredevelopers.xstore.pro/public/files/Changelog_2_3.pdf3 xStore ul. Ogrodowa 58, 00-876...
-
xStore
ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected] www.xstore.pro
Content
1. Changes in requests of request-response commands; .............................. 3
a) getProfitCalculation ............................................................................ 3
b) getTrades .......................................................................................... 3
c) getTickPrices ..................................................................................... 3
d) Any/free-chosen command ................................................................. 4
2. Changes in responses of request-response commands ............................. 5
a) tradeTransactionStatus ...................................................................... 5
b) getMarginLevel .................................................................................. 5
c) getCurrentUserData ........................................................................... 6
d) getSymbol, getAllSymbols .................................................................. 6
e) TRADE_RECORD (getTradesHistory, getTrades, getTradeRecords
response) .............................................................................................. 7
f) getTickPrices ...................................................................................... 8
g) TICK_RECORD (getTickPrices response) .............................................. 8
h) NEWS_TOPIC_RECORD (getNews response) ....................................... 9
i) CALENDAR_RECORD (getCalendar response) ....................................... 9
3. Introduced changes in streaming commands ......................................... 11
a) STREAMING_TRADE_RECORD (getTrades response) ......................... 11
b) getTradeStatus (response) ............................................................... 12
c) STREAMING_CANDLE_RECORD (getCandles response) ...................... 12
d) STREAMING_PROFIT_RECORD (response to getProfits) ..................... 13
e) error ............................................................................................... 13
f) getTickPrices (request) ..................................................................... 13
g) getCandles (request) ........................................................................ 14
4. Functions deleted ................................................................................ 15
a) getChartLastRequest and getChartRangeRequest ............................... 15
b) tradeTransaction .............................................................................. 15
5. New functions ..................................................................................... 15
-
`
2
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
a) getCandles ...................................................................................... 15
b) addOrder......................................................................................... 16
c) modifyPosition ................................................................................. 16
d) modifyPending ................................................................................. 17
e) closePosition .................................................................................... 17
f) deletePending .................................................................................. 18
g) closePositions .................................................................................. 18
h) getCashOperationsHistory ................................................................ 18
6. Changes of field‟s names ..................................................................... 20
a) tradeTransactionStatus (request-response) ....................................... 20
b) getTradeStatus (streaming) .............................................................. 20
c) stopTradeStatus (streaming) ............................................................. 20
d) getCurrentUserData (request-response) ............................................ 20
e) getMarginLevel (request-response) ................................................... 20
f) getBalance (streaming) ..................................................................... 20
7. Table of changes of „cmd‟ field into „side‟ and „tradeType‟ ...................... 21
-
`
3
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
1. Changes in requests of request-response commands;
a) getProfitCalculation
API 2: API 3:
{ "command": "getProfitCalculation", "arguments": { "closePrice": 1.3000, "cmd": 0, "openPrice": 1.2233, "symbol": "EURPLN", "volume": 1.0 } }
{ "command": "getProfitCalculation", "arguments": { "closePrice": 1.3000, "openPrice": 1.2233, "side": 0, "symbol": "EURPLN", "tradeType": 0, "volume": 1.0 } }
Comment:
Replacing field ‘cmd’ with ‘side’ and ‘tradeType’ fields (details in the table below)
b) getTrades
API 2: API 3:
{ "command": "getTrades", "arguments": { "openedOnly": true } }
{ "command": "getTrades" }
c) getTickPrices
API 2: API 3:
{ "command": "getTickPrices", "arguments": { "level": 0, "symbols": ["EURPLN", ...],
{ "command": "getTickPrices", "arguments": { "level": 0, "symbols": ["EURPLN", ...]
-
`
4
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
"timestamp": 1262944112000 } }
} }
Comment:
‘timestamp’ field was deleted.
d) Any/free-chosen command
API 2: API 3:
{ "command": "commandName", "arguments": { ... }, "prettyPrint": true }
{ "command": "commandName", "arguments": { ... } }
Comment:
‘prettyPrint’ field was deleted.
-
`
5
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
2. Changes in responses of request-response commands
a) tradeTransactionStatus
API 2: API 3:
{ "status": true, "returnData": { "ask": 1.392, "bid": 1.392, "customComment": "Some text", "message": null, "order": 43, "requestStatus": 3 } }
{ "status": true, "returnData": { "customComment": "Some text", "message": null, "order": 43, "price": 1.392, "requestStatus": 3 } }
Comment:
Replacing fields ‘ask’ and ‘bid’ with ‘price’ field.
b) getMarginLevel
API 2: API 3:
{ "status": true, "returnData": { "balance": 995800269.43, "credit": 1000.00, "currency": "PLN", "equity": 995985397.56, "margin": 572634.43, "margin_free": 995227635.00, "margin_level": 173930.41 } }
{ "status": true, "returnData": { "balance": 995800269.43, "credit": 1000.00, "currency": "PLN", "equity": 995985397.56, "margin": 572634.43, "marginFree": 995227635.00, "marginLevel": 173930.41 } }
Comment:
Field’s names were changed.
-
`
6
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
c) getCurrentUserData
API 2: API 3:
{ "status": true, "returnData": { "companyUnit": 8, "currency": "PLN", "group": "PLeurSTANDARD200", "ibAccount": false, "leverage": 1, "leverageMultiplier": 0.25, "spreadType": "FLOAT" } }
{ "status": true, "returnData": { "companyUnit": 8, "currency": "PLN", "group": "PLeurSTANDARD200", "ibAccount": false, "leverageMultiplier": 0.25, "spreadType": "STP" } }
Comment:
Inactive ‘leverage’ field was deleted. An appropriate leverage value is available in
‘leverageMultiplier’ field. New possible value of ‘spreadType’ field.
d) getSymbol, getAllSymbols
API 2: API 3:
{ "ask": 4000.0, "bid": 4000.0, "categoryName": "Forex", "contractSize": 100000, "currency": "USD", "currencyPair": true, "currencyProfit": "SEK", "description": "USD/PLN", "expiration": null, "groupName": "Minor", "high": 4000.0, "initialMargin": 0, "instantMaxVolume": 0, "leverage": 1, "longOnly": false, "lotMax": 10.0, "lotMin": 0.1, "lotStep": 0.1, "low": 3500.0, "marginHedged": 0, "marginHedgedStrong": false,
{ "ask": 4000.0, "bid": 4000.0, "categoryName": "Forex", "contractSize": 100000, "currency": "USD", "currencyPair": true, "currencyProfit": "SEK", "description": "USD/PLN", "groupName": "Minor", "high": 4000.0, "leverage": 1.0, "lotMax": 10.0, "lotMin": 0.1, "lotStep": 0.1, "low": 3500.0,
-
`
7
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
"marginMaintenance": null, "marginMode": 101, "percentage": 100.0, "precision": 2, "profitMode": 5, "quoteId": 1, "spreadRaw": 0.000003, "spreadTable": 0.00042, "starting": null, "stopsLevel": 0, "swap_rollover3days": 0, "swapEnable": true, "swapLong": -2.55929, "swapShort": 0.131, "swapType": 0, "symbol": "USDPLN", "tickSize": 1.0, "tickValue": 1.0, "time": 1272446136891, "timeString": "Thu May 23 12:23:44 EDT 2013", "type": 21 }
"marginMode": 101, "percentage": 100.0, "precision": 2, "profitMode": 5, "quoteId": 1, "spreadRaw": 0.000003, "spreadTable": 0.00042, "stopsLevel": 0, "swapEnable": true, "swapLong": -2.55929, "swapShort": 0.131, "swapType": 0, "symbol": "USDPLN", "tickSize": 1.0, "tickValue": 1.0, "time": 1272446136891, "timeString": "Thu May 23 12:23:44 EDT 2013", "type": 21 }
Comment:
Inactive fields were deleted. ‘leverage’ field type was changed.
e) TRADE_RECORD (getTradesHistory, getTrades,
getTradeRecords response)
API 2: API 3:
{ "close_price": 1.3256, "close_time": null, "close_timeString": null, "closed": false, "cmd": 0, "comment": "Web Trader", "commission": 0.0, "customComment": "Some text", "digits": 4, "expiration": null, "expirationString": null, "margin_rate": 0.0, "open_price": 1.4, "open_time": 1272380927000, "open_timeString": "Fri Jan 11 10:03:36
{ "closePrice": 1.3256, "closeTime": null, "closeTimeString": null, "closed": false, "comment": "Web Trader", "commission": 0.0, "customComment": "Some text", "digits": 4, "expiration": null, "expirationString": null, "openPrice": 1.4, "openTime": 1272380927000, "openTimeString": "Fri Jan 11 10:03:36
-
`
8
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
CET 2013", "order": 7497776, "order2": 1234567, "position": 1234567, "profit": -2196.44, "sl": 0.0, "storage": -4.46, "symbol": "EURUSD", "timestamp": 1272540251000, "tp": 0.0, "volume": 0.10 }
CET 2013", "order": 7497776, "order2": 1234567, "position": 1234567, "profit": -2196.44, "recordType": 0, "side": 0, "sl": 0.0, "storage": -4.46, "symbol": "EURUSD", "tp": 0.0, "tradeType": 0, "volume": 0.10 }
Comment:
Inactive „margin_rate‟ and „timestamp‟ fields were deleted. „cmd‟ field was
replaced with „side‟ and „tradeType‟ fields(details in the table below). New
field „recordType‟ was added. Field‟s name connected with price and
open/close position‟s time was changed.
f) getTickPrices
API 2: API 3:
{ "status": true, "returnData": { "quotations": [TICK_RECORD, ...] } }
{ "status": true, "returnData": [TICK_RECORD, ...] }
Comment:
Changed message format.
g) TICK_RECORD (getTickPrices response)
API 2: API 3:
{ "ask": 4000.0, "askVolume": 15000,
{ "ask": 4000.0, "askVolume": 15000,
-
`
9
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
"bid": 4000.0, "bidVolume": 16000, "high": 4000.0, "level": 0, "low": 3500.0, "spreadRaw": 0.000003, "spreadTable": 0.00042, "symbol": "KOMB.CZ", "timestamp": 1272529161605 }
"bid": 4000.0, "bidVolume": 16000, "high": 4000.0, "level": 0, "low": 3500.0, "quoteId": 1, "spreadRaw": 0.000003, "spreadTable": 0.00042, "symbol": "KOMB.CZ", "timestamp": 1272529161605 }
Comment:
„quoteId‟ field was added where simultaneously TICK_RECORD and
STREAMING_TICK_RECORD was unified: both request and the command in
streaming connection gives back the same object - TICK_RECORD.
h) NEWS_TOPIC_RECORD (getNews response)
API 2: API 3:
{ "body": "...", "bodylen": 110, "key": "1f6da766abd29927aa85", "time": 1262944112000, "timeString": "May 17, 2013 4:30:00 PM", "title": "Breaking trend" }
{ "body": "...", "key": "1f6da766abd29927aa85", "time": 1262944112000, "title": "Breaking trend" }
Comment:
Fields „bodylen‟ and „timeString‟ were deleted where simultaneously
NEWS_TOPIC_RECORD and STREAMING_NEWS_RECORD were unified: both
request and the streaming command gives back the same object -
NEWS_RECORD.
i) CALENDAR_RECORD (getCalendar response)
API 2: API 3:
{ "country": "CA",
{ "country": "CA",
-
`
10
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
"current": "", "forecast": "", "impact": "3", "period": "(FEB)", "previous": "58.3", "time": 1374846900000, "title": "Ivey Purchasing Managers Index" }
"current": "", "forecast": "", "impact": 1, "period": "(FEB)", "previous": "58.3", "time": 1374846900000, "title": "Ivey Purchasing Managers Index" }
Comment:
The type of „impact‟ field was changed into whole number.
-
`
11
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
3. Introduced changes in streaming commands
a) STREAMING_TRADE_RECORD (getTrades response)
API 2: API 3:
{ "close_price": 1.3256, "close_time": null, "closed": false, "cmd": 0, "comment": "Web Trader", "commission": 0.0, "customComment": "Some text", "digits": 4, "expiration": null, "margin_rate": 3.9149000, "open_price": 1.4, "open_time": 1272380927000, "order": 7497776, "order2": 1234567, "position": 1234567, "profit": 68.392, "sl": 0.0, "state": "Modified", "storage": -4.46, "symbol": "EURUSD", "tp": 0.0, "type": 0, "volume": 0.10 }
{ "closePrice": 1.3256, "closeTime": null, "closed": false, "comment": "Web Trader", "commission": 0.0, "customComment": "Some text", "digits": 4, "expiration": null, "openPrice": 1.4, "openTime": 1272380927000, "order": 7497776, "order2": 1234567, "position": 1234567, "profit": 68.392, "side": 0, "sl": 0.0, "state": 0, "storage": -4.46, "symbol": "EURUSD", "tp": 0.0, "recordType": 0, "tradeType": 0, "volume": 0.10 }
Comment:
Inactive „margin_rate‟ field was deleted. Field „cmd‟ was replaced with „side‟
and „tradeType‟ (details in the table below). New field „recordType‟ was
added. The name of fields connected with price and time of opening/closing
position was changed. The name of „type‟ field was changed into
„recordType‟. The value of „state‟ field was changed from “Modified”/”Deleted”
into 0/1.
-
`
12
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
b) getTradeStatus (response)
API 2: API 3:
{ "command": "tradeStatus", "data": STREAMING_TRADE_STATUS_RECORD }
{ "command": "orderStatus", "data": ORDER_STATUS_RECORD }
Comment:
The value of „command‟ field was changed.
STREAMING_TRADE_STATUS_RECORD and tradeTransactionStatus response
was unified: both the request and the command in streaming connection
gives back the same object - ORDER_STATUS_RECORD.
c) STREAMING_CANDLE_RECORD (getCandles response)
API 2: API 3:
{ "close": 4.1849, "ctm": 1378369375000, "ctmString": "Sep 05, 2013 10:22:55 AM", "high": 4.1854, "low": 4.1848, "open": 4.1848, "quoteId": 2, "symbol": "EURUSD", "vol": 0.0 }
{ "close": 4.1849, "complete": true, "timestamp": 1378369375000, "timeString": "Sep 05, 2013 10:22:55 AM", "high": 4.1854, "low": 4.1848, "open": 4.1848, "period": 5, "quoteId": 2, "symbol": "EURUSD" }
Comment:
Two fields were added - „period‟ and „complete‟. Inactive field „vol‟ was
deleted. Names of several fields connected with time of candle were changed.
-
`
13
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
d) STREAMING_PROFIT_RECORD (response to
getProfits)
API 2: API 3:
{ "order": 7497776, "order2": 7497777, "position": 7497776, "profit": 7076.52 }
{ "closePrice": 1.39302, "order": 7497776, "order2": 7497777, "position": 7497776, "profit": 7076.52 }
Comment:
„closePrice‟ field was added.
e) error
Format: STREAMING_ERROR_RECORD:
{ "command": "error", "data": STREAMING_ERROR_RECORD }
{ "errorCode": "EX123", "errorDescr": "Error description" }
Comment:
Messages about errors in streaming connection were added. Those messages
are sent automatically and user does not have to subscribe to them.
f) getTickPrices (request)
API 2: API 3:
{ "command": "getTickPrices", "streamSessionId": "1234", "symbol": "EURUSD", "minArrivalTime": 5000, "maxLevel": 2 }
{ "command": "getTickPrices", "streamSessionId": "1234", "symbols": ["EURUSD", ...], "minArrivalTime": 5000, "maxLevel": 2 }
-
`
14
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
Comment:
Subscription to prices of many instruments with the usage of one command
was facilitated.
g) getCandles (request)
API 2: API 3:
{ "command": "getCandles", "streamSessionId": "1234", "symbol": "EURUSD" } { "command": "stopCandles", "symbol": "EURUSD" }
{ "command": "getCandles", "streamSessionId": "1234", "symbol": "EURUSD", "onlyComplete": true, "period": 5 } { "command": "stopCandles", "symbol": "EURUSD", "period": 5 }
Comment:
There are new fields - „onlyComplete‟ and „period‟. Subscription to candles
from chosen time range, to closed ones and to all of them is facilitated.
-
`
15
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
4. Functions deleted
a) getChartLastRequest and getChartRangeRequest
Those functions were replaced with one - „getCandles‟ (details below)
b) tradeTransaction
This function was separated into 5 new: addOrder, closePosition,
deletePending, modifyPosition, modifyPending (details below).
5. New functions
a) getCandles
request: response:
{ "command": "getCandles", "arguments": { "end": 1362944412000, "period": 5, "start": 1262944112000, "symbol": "EURUSD" } }
{ "status": true, "returnData": { "candles": [CANDLE_RECORD, ...], "digits": 4 } }
CANDLE_RECORD: { "close": 4.1849, "high": 4.1854, "low": 4.1848, "open": 4.1848, "timestamp": 1389362640000, "timeString": "Jan 10, 2014 3:04:00 PM" }
Comment:
This function replaced getChartLastRequest and getChartRangeRequest. The
exact and precise fields description is available in xAPI documentation in the
following link: http://developers.xstore.pro/documentation/3.0#getCandles
http://developers.xstore.pro/documentation/3.0#getCandles
-
`
16
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
b) addOrder
request: response:
{ "command": "addOrder", "arguments": { "customComment": "Some text", "expiration": 1262944112000, "price": 37.47, "side": 0, "sl": 0.0, "symbol": "EURUSD", "tp": 0.0, "tradeType": 0, "volume": 5.00 } }
{ "status": true, "returnData": { "order": 313438 } }
Comment:
This function was abstracted (except 4 others) from old function
tradeTransaction. The exact fields description is available in xAPI
documentation in the following link:
http://developers.xstore.pro/documentation/3.0#addOrder
c) modifyPosition
request: response:
{ "command": "modifyPosition", "arguments": { "position": 7497776, "sl": 0.0, "tp": 0.0 } }
{ "status": true, "returnData": { "order": 313438 } }
Comment:
This function was abstracted (except 4 others) from old function
tradeTransaction. The exact fields description is available in xAPI
documentation in the following link:
http://developers.xstore.pro/documentation/3.0#modifyPosition
http://developers.xstore.pro/documentation/3.0#modifyPosition
-
`
17
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
d) modifyPending
request: response:
{ "command": "modifyPending", "arguments": { "customComment": "Some text", "expiration": 1262944112000, "order": 313406, "price": 37.47, "sl": 0.0, "tp": 0.0 } }
{ "status": true, "returnData": { "order": 313438 } }
Comment:
This function was abstracted (except 4 others) from old function
tradeTransaction. The exact fields description is available in xAPI
documentation in the following link:
http://developers.xstore.pro/documentation/3.0#modifyPending
e) closePosition
request: response:
{ "command": "closePosition", "arguments": { "position": 7497776, "price": 37.47, "volume": 5.00 } }
{ "status": true, "returnData": { "order": 313438 } }
Comment:
This function was abstracted (except 4 others) from old function
tradeTransaction. The exact fields description is available in xAPI
documentation in the following link:
http://developers.xstore.pro/documentation/3.0#closePosition
http://developers.xstore.pro/documentation/3.0#modifyPendinghttp://developers.xstore.pro/documentation/3.0#closePosition
-
`
18
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
f) deletePending
request: response:
{ "command": "deletePending", "arguments": { "order": 313406 } }
{ "status": true, "returnData": { "order": 313438 } }
Comment:
This function was abstracted (except 4 others) from old function
tradeTransaction. The exact fields description is available in xAPI
documentation in the following link:
http://developers.xstore.pro/documentation/3.0#deletePending
g) closePositions
request: response:
{ "command": "closePositions", "arguments": { "positions": [123, 456, ...] } }
{ "status": true, "returnData": { "orders": [12321, 23432, ...] } }
Comment:
The exact fields description is available in xAPI documentation in the
following link:
http://developers.xstore.pro/documentation/3.0#closePositions
h) getCashOperationsHistory
request: response:
{ "command": "getCashOperationsHistory", "arguments": { "end": 0, "start": 1275993488000
{ "comment": "Profit of position #123", "nominal": 6.00, "timestamp": 1395755870000, "type": 1
http://developers.xstore.pro/documentation/3.0#deletePendinghttp://developers.xstore.pro/documentation/3.0#closePositions
-
`
19
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
} }
}
Comment:
The exact fields description is available in xAPI documentation in the
following link:
http://developers.xstore.pro/documentation/3.0#getCashOperationsHistory
http://developers.xstore.pro/documentation/3.0#getCashOperationsHistory
-
`
20
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
6. Changes of field’s names
a) tradeTransactionStatus (request-response)
Changed into getOrderStatus.
b) getTradeStatus (streaming)
Changed into getOrderStatus.
c) stopTradeStatus (streaming)
Changed into stopOrderStatus.
d) getCurrentUserData (request-response)
Changed into getAccountInfo.
e) getMarginLevel (request-response)
Changed into getAccountIndicators.
f) getBalance (streaming)
Changed into getAccountIndicators.
-
`
21
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro
7. Table of changes of ‘cmd’ field into ‘side’ and
‘tradeType’
API 3:
API 2:
In API 3 ‘cmd’ field was replaced with the following values of ‘side’ and ‘tradeType’ fields.
Up to now only one ‘cmd’ field appeared in API.
Trade Type Side cmd
value value value
0 0 0
0 1 1
1 0 2
1 1 3
2 0 4
2 1 5
3 - 6
4 - 7
-
xStore ul. Ogrodowa 58, 00-876 Warszawa, Tel.: +48 22 201 95 70, E-mail: [email protected]
www.xstore.pro