ZuluTrading Forex API Reference

ZuluTrading Binary API Reference

Go to the ZuluTrading Forex API Reference

1. Introduction

2. Environment

3. Services

• Assets
Description
:
Returns the available assets the user can trade
REST URL
:
/requestAssets
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
http://tradingserverbinary.zulutrade.com/requestAssets
JSON Response
{ "success": true, "error": null, "result": [ "EUR/USD", "AUD/USD", "USD/JPY", "GBP/USD", "USD/CAD", "USD/CHF", "EUR/AUD", "EUR/JPY", "GBP/JPY", "EUR/GBP" ] }
• Balance
Description
:
Returns the account's balance
REST URL
:
/requestBalance
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
http://tradingserverbinary.zulutrade.com/requestBalance
JSON Response
{ "success": true, "error": null, "result": 9676.96 }
• Open Positions
Description
:
Returns the account's open positions
REST URL
:
/requestOpenPositions
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
http://tradingserverbinary.zulutrade.com/requestOpenPositions
JSON Response
{ "success": true, "error": null, "result": [ { "positionId": 3006728, "optionId": 7284878, "asset": "EUR/USD", "positionType": "call", "amount": 12, "entryRate": 1.07621, "endRate": null, "executionDate": "2015-04-09 11:52:09", "endDate": "2015-04-09 11:53:09", "payout": null, "netpnl": null, "sixtySeconds": true, "positionStatus": "open", "winsum": 20.52, "losesum": 0 }, { "positionId": 3006730, "optionId": 7284879, "asset": "USD/JPY", "positionType": "put", "amount": 25, "entryRate": 119.94, "endRate": null, "executionDate": "2015-04-09 11:52:28", "endDate": "2015-04-09 11:55:28", "payout": null, "netpnl": null, "sixtySeconds": true, "positionStatus": "open", "winsum": 48.25, "losesum": 0 } ] }
• Closed Positions
Description
:
Returns all the account's closed positions (i) or closed positions by date criteria (ii)
REST URL (i)
:
/requestClosedPositions
REST URL (ii)
:
/requestClosedPositions/?startDate={startDateString}&endDate={endDateString}
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
(i) http://tradingserverbinary.zulutrade.com/requestClosedPositions (ii) http://tradingserverbinary.zulutrade.com/requestClosedPositions/?startDate=2016-03-29&endDate=2016-04-01
JSON Response
{ "success": true, "error": null, "result": [ { "positionId": 2914565, "optionId": 7201962, "asset": "EUR/USD", "positionType": "call", "amount": 12, "entryRate": 1.08418, "endRate": 1.08394, "executionDate": "2015-03-30 14:42:28", "endDate": "2015-03-30 14:43:28", "payout": 0, "netpnl": -12, "sixtySeconds": true, "positionStatus": "lost", "winsum": 20.52, "losesum": 0 }, { "positionId": 2914603, "optionId": 7201990, "asset": "EUR/USD", "positionType": "call", "amount": 13, "entryRate": 1.08393, "endRate": 1.08396, "executionDate": "2015-03-30 14:45:23", "endDate": "2015-03-30 14:46:23", "payout": 22.23, "netpnl": 9.23, "sixtySeconds": true, "positionStatus": "won", "winsum": 22.23, "losesum": 0 } ] }
• Regular Options
Description
:
Returns the available open options the account can trade for a specific asset
REST URL
:
/requestRegularOptions
Header
:
Basic authentication
Response content type
:
application/json
Method
:
POST
Sample Call
http://tradingserverbinary.zulutrade.com/requestRegularOptions
Request Body
{ "asset":"EUR/USD" }
JSON Response
{ "success": true, "error": null, "result": [ { "id": 5197581, "endDate": "2015-04-30 17:10:00", "profit": 77, "loss": 100, "asset": "EUR/USD" }, { "id": 5197585, "endDate": "2015-06-30 17:10:00", "profit": 77, "loss": 100, "asset": "EUR/USD" }, { "id": 5475131, "endDate": "2015-07-31 17:10:00", "profit": 77, "loss": 100, "asset": "EUR/USD" } ] }
• Open 60″ Position
Description
:
Sends a request to open a 60" position
REST URL
:
/openSixtySecondsPosition
Header
:
Basic authentication
Response content type
:
application/json
Method
:
POST
Sample Call
http://tradingserverbinary.zulutrade.com/openSixtySecondsPosition
Request Body
{ "positionType":"call", "amount":12, "asset":"EUR/USD", "seconds":60 }
JSON Response
{ "success": true, "error": null, "result": { "positionId": 3006804, "optionId": 7284945, "asset": "EUR/USD", "positionType": "call", "amount": 12, "entryRate": 1.07676, "endRate": null, "executionDate": "2015-04-09 11:57:32", "endDate": "2015-04-09 11:58:32", "payout": null, "netpnl": null, "sixtySeconds": true, "positionStatus": "open", "winsum": 20.52, "losesum": 0 } }
• Open Regular Position
Description
:
Sends a regular position opening request, returns the position's data
REST URL
:
/openRegularPosition
Header
:
Basic authentication
Response content type
:
application/json
Method
:
POST
Sample Call
http://tradingserverbinary.zulutrade.com/openRegularPosition
Request Body
{ "positionType":"call", "amount":25, "expirationDate":"2015-04-09 12:15:00", "asset":"EUR/USD" }
JSON Response
{ "success": true, "error": null, "result": { "positionId": 3006930, "optionId": 7247038, "asset": "EUR/USD", "positionType": "call", "amount": 25, "entryRate": 1.0769, "endRate": null, "executionDate": "2015-04-09 11:15:00", "endDate": "2015-04-09 12:15:00", "payout": null, "netpnl": null, "sixtySeconds": true, "positionStatus": "open", "winsum": 45.75, "losesum": 0 } }
• Trader Statistics
Description
:
Returns the trader account's statistics
REST URL
:
/requestTraderStatistics
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
http://tradingserverbinary.zulutrade.com/requestTraderStatistics
JSON Response
{ "success": true, "error": null, "result": { "traderName": "mytrader", "strategy": "I have an awesome strategy! for real!", "country": "Italy", "zuluRank": 57, "roi": 83, "profit": 20.75, "minimumRequiredCapital": 25, "winPercentage": 40, "totalPositions": 10, "weeks": 3, "followers": 0, "amountFollowing": 0 } }
• Zulu Performance
Description
:
Returns the trader account's statistics
REST URL
:
/requestZuluPerformance/{numberOfTradersToReturn}
Header
:
Basic authentication
Response content type
:
application/json
Method
:
GET
Sample Call
http://tradingserverbinary.zulutrade.com/requestZuluPerformance/3
JSON Response
{ "success": true, "error": null, "result": [ { "traderName": "mytrader1", "strategy": "awesome strategy!!", "country": "France", "zuluRank": 1, "roi": 488, "profit": 488101.85, "minimumRequiredCapital": 100000, "winPercentage": 81.31868131868131, "totalPositions": 91, "weeks": 20, "followers": 11, "amountFollowing": 100000 }, { "traderName": "mytrader2", "strategy": "awesome strategy!!", "country": "United Kingdom", "zuluRank": 2, "roi": 344, "profit": 344031.5, "minimumRequiredCapital": 100000, "winPercentage": 85, "totalPositions": 60, "weeks": 18, "followers": 10, "amountFollowing": 100000 }, { "traderName": "mytrader3", "strategy": "awesome strategy!!", "country": "Germany", "zuluRank": 3, "roi": 451, "profit": 451357.9, "minimumRequiredCapital": 100000, "winPercentage": 56.91318327974277, "totalPositions": 311, "weeks": 20, "followers": 4, "amountFollowing": 0 } ] }

4. Errors

The following error codes may be returned
Error code Name Description
0Service is Unavailable at the momentThe service is not available at this time.
1Internal ErrorAn unknown error occurred during execution of the request.
2Account not FoundThe account was not found.
3SpotOptionErrorZuluTrade processed the request but SpotOption could not process it.
4Trading ErrorAn error occurred while executing the trading request.
5Instrument not SupportedThe instrument included in this call is not supported.
6Invalid Position TypeValidation error caused when the user tried to open a position and did not send 'call' or 'put' as position type.
7Option not FoundRejection caused when a user sends a regular position opening request and the selected combination of instrument/expirationDate does not correspond to an open option.
8Invalid Expiration DateRejection caused when a user sends a regular position opening request on an invalid expiration date.
9Invalid ExpiryRejection caused when a user sends a sixty seconds position opening request on an invalid sixty seconds expiry.
10Sixty Seconds SuspendedRejection caused by SpotOption on sixty seconds when they are suspended.
11Invalid AmountRejection caused when a user sends a position opening request with an amount that is not acceptable.
12Authorization ErrorUser not authorized for this request.

5. Tutorials

  • Java
    • Click here for a step-by-step tutorial on using the API, using Java and the eclipse IDE.

6. Support

5. Support

  • Please, visit our dedicated section in our ZuluTrade forum for any questions regarding the ZuluTrading Forex API.
  • Please, visit our dedicated section in our ZuluTrade forum for any questions regarding the ZuluTrading Binary API.