Best Of
API changes: Subscription call bug fix for req_id argument
Dear developers,
As per current API behaviour applicable for the following subscription calls:
ticks
ticks_history
exchange_rates
If a request is made with different req_id, API considers those as separate subscriptions requests and provides multiple subscription responses for the same symbol or same asset requested.
For example, currently, subscribes to tick with different req_id with same symbol, for example,
{ "ticks": "R_50", "subscribe": 1, "req_id": 1 }
{ "ticks": "R_50", "subscribe": 1, "req_id": 2 }
will lead to two separate subscriptions
{ "echo_req": { "req_id": 1, "subscribe": 1, "ticks": "R_50" }, "msg_type": "tick", "req_id": 1, "subscription": { "id": "f0499013-9edd-3b7b-88b2-27b21e2be755" }, "tick": { "ask": 191.5129, "bid": 191.4929, "epoch": 1698231168, "id": "f0499013-9edd-3b7b-88b2-27b21e2be755", "pip_size": 4, "quote": 191.5029, "symbol": "R_50" } }
{ "echo_req": { "req_id": 2, "subscribe": 1, "ticks": "R_50" }, "msg_type": "tick", "req_id": 2, "subscription": { "id": "34ccc31a-27d7-3c08-9158-6d0778f66ddd" }, "tick": { "ask": 191.5568, "bid": 191.5368, "epoch": 1698231170, "id": "34ccc31a-27d7-3c08-9158-6d0778f66ddd", "pip_size": 4, "quote": 191.5468, "symbol": "R_50" } }
when you send forget_all call to forget all the subscriptions
{ "forget_all": "ticks" }
you will notice that two subscriptions were active
{ "echo_req": { "forget_all": "ticks" }, "forget_all": [ "34ccc31a-27d7-3c08-9158-6d0778f66ddd", "f0499013-9edd-3b7b-88b2-27b21e2be755" ], "msg_type": "forget_all" }
We are fixing this bug of removing req_id consideration for subscription, and going forward the second request for the same symbol with different req_id
{ "ticks": "R_50", "subscribe": 1, "req_id": 2 }
will result in the following error
{ "echo_req": { "req_id": 2, "subscribe": 1, "ticks": "R_50" }, "error": { "code": "AlreadySubscribed", "message": "You are already subscribed to R_50" }, "msg_type": "tick", "req_id": 2 }
But request for subscription with different symbol, for example:
{ "ticks": "R_100", "subscribe": 1, "req_id": 2 }
will work normally
{ "echo_req": { "req_id": 2, "subscribe": 1, "ticks": "R_100" }, "msg_type": "tick", "req_id": 2, "subscription": { "id": "1c653e0b-61f8-00ba-fbee-b3b46ac01cb1" }, "tick": { "ask": 1442.01, "bid": 1441.61, "epoch": 1698231336, "id": "1c653e0b-61f8-00ba-fbee-b3b46ac01cb1", "pip_size": 2, "quote": 1441.81, "symbol": "R_100" } }
This change applies to the following API calls:
ticks
ticks_history
exchange rates
Please make the necessary changes to your app(s) by week starting December 4, 2023.
If you have any questions, write to us at api-support@deriv.com.
Re: How to activate "Allow equals" bay API call ?
There is a new "contract_category": "callputequal"
in the contracts_for
API response, which has the contract_type
CALLE
and PUTE
. You can use these as your contract type in proposal to convey call equals (higher than or equal to) and put equals (lower than or equal to) options.
NEW BOT - LIVE STREAMING AUTO TRADING THAT IS UNLIKE ANY OTHER ~ NO RECORDING
https://youtube.com/live/OstG9gapxDo?si=8BYFfXrTZHtMmLce
AUTO TRADING THAT IS UNLIKE ANY OTHER
LIVE STREAMING , NO RECORDING
Re: Need developer to build bot in NodeJS
Hello, I can help you make this. I made https://dstrategyiq.com. send me an email at zolaballantyne@gmail.com
API changes: set_settings structure change
Dear developers,
We’re changing the structure of the set_settings API response from integer to object. This will be released in 3-4 weeks.
Note: This update is not backwards compatible. Please make the necessary changes to your app(s) before Dec 19.
Changes to the set_settings response
set_settings is now an object with a notification attribute that will return either null or an object containing two attributes: code and message_to_client
"set_settings": { "notification": null } "set_settings": { "notification": { "code": "AddressMismatchFixed", "message_to_client": "Address has been fixed." } }
If you have any questions, write to us at api-support@deriv.com.
API - Buy Contract
Hi,
I have a technical question in regards to the API for buy contract. In the Buy Contract API, the required JSON schema to pass as shown below.
My questions are:
What is Contract_type?
Can you give me a list valid contract type?
I will only trade on Rise/Fall type, where and what value should I pass in if I wanted to buy a rise binary option?
Regards,
Eng Tang
I am currently registered with a virtual account, but will upgrade to real account.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"title": "Buy a Contract Send",
"description": "Buy a Contract",
"properties": {
"buy": {
"type": "string",
"pattern": "^(?:[\w-]{32,128}|1)$",
"description": "Either the id received from a Price Proposal (proposal) call, or 1 if contract buy parameters are passed in the parameters field",
"required": "1"
},
"price": {
"type": "number",
"description": "Maximum price at which to purchase the contract.",
"required": "1"
},
"parameters": {
"type": "object",
"description": "Optional field, used to pass the parameters for contract buy",
"properties": {
"amount": {
"type": "number",
"description": "Proposed payout or stake value"
},
"basis": {
"description": "Indicate whether amount is 'payout' or 'stake'",
"enum": [
"payout",
"stake"
]
},
"contract_type": {
"type": "string",
"description": "A valid contract-type",
"pattern": "^\w{2,30}$",
"required": "1"
},
"currency": {
"type": "string",
"description": "This can only be the account-holder's currency",
"pattern": "^[A-Z]{3}$",
"required": "1"
},
"date_start": {
"type": "integer",
"description": "For forward-starting contracts, epoch value of the starting time of the contract."
},
"date_expiry": {
"type": "integer",
"description": "Epoch value of the expiry time of the contract. You must either specify date_expiry or duration."
},
"duration": {
"type": "integer",
"description": "Duration quantity"
},
"duration_unit": {
"description": "Duration unit is s(seconds), m(minutes), h(hours), d(days), t(ticks)",
"enum": [
"d",
"m",
"s",
"h",
"t"
]
},
"symbol": {
"type": "string",
"description": "Symbol code",
"pattern": "^\w{2,30}$",
"required": "1"
},
"barrier": {
"type": "string",
"description": "Barrier for the contract (or last digit prediction for digit contracts). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), meaning that the entry spot would be adjusted accordingly with that amount to define a barrier.",
"pattern": "^[+-]?\d+\.?\d$"
},
"barrier2": {
"type": "string",
"pattern": "^[+-]?\d+\.?\d$",
"description": "Low barrier for the contract (for contracts with two barriers). Contracts less than 24 hours in duration would need a relative barrier (barriers which need +/-), meaning that the entry spot would be adjusted accordingly with that amount to define a barrier."
},
"amount_per_point": {
"type": "number",
"description": "[For spread contracts only] Amount per point"
},
"stop_type": {
"description": "[For spread contracts only] Stop type (dollar or point)",
"enum": [
"dollar",
"point"
]
},
"stop_profit": {
"type": "number",
"description": "[For spread contracts only] Stop profit amount"
},
"stop_loss": {
"type": "number",
"description": "[For spread contracts only] Stop loss amount"
}
}
},
"passthrough": {
"type": "object",
"description": "Optional field, used to pass data through the websocket, which may be retrieved via the echo_req output field."
},
"req_id": {
"type": "integer",
"description": "Optional field to map request to response"
}
},
"additionalProperties": false
}
Re: API - Buy Contract
Hello.
This is the list I have.
`Up/Down
Rise/Fall
"contract_type":"CALL"
"contract_type":"PUT"
Toutch/No Touch
"contract_type":"ONETOUCH"
"contract_type":"NOTOUCH"
In/Out
Ends In/Out
"contract_type":"EXPIRYRANGE"
"contract_type":"EXPIRYMISS
Stays In/Goes Out
contract_type":"RANGE"
"contract_type":"UPORDOWN"
Asians
"contract_type":"ASIANU"
"contract_type":"ASIAND"
Digits
Matches/Differs
"contract_type":"DIGITMATCH"
"contract_type":"DIGITDIFF"
Even/Odd
"contract_type":"DIGITODD"
"contract_type":"DIGITEVEN"
Over/Under
"contract_type":"DIGITOVER"
"contract_type":"DIGITUNDER"
Spreads
"contract_type":"SPREADU"
"contract_type":"SPREADD"`
Regards
Who can coding for me in python. only login, get balance and table, and trade. buy Call - Rise/Fall
Who can code in python for me,
login, and trade put call 5 ticks.
buy Call> when ticks is Rising
Put when tick is Falling
Trading is suspended due to missing market (old) data.
Hello everyone
A few days ago I had integrated the binary api and it was working normally with my platform and the binary integration
based on this documentation
But three days ago the api has presented problems when trying to buy a contract,
First you must generate the proposal and then the purchase
But ended the sales proposal the following error
"Trading is suspended due to missing market (old) data."
I don't know why this error is generated, sometimes you buy but the error is already recurring.
I thought that it was my code that had the problem but I decided to do it with the base code that delivers binary and also presents the same error
does anyone know why it happens?
let query = { "proposal": 1, "amount": 20, "basis": "stake", "contract_type": "MULTUP", "currency": "USD", "multiplier":"100", "symbol": "R_100" } ws.send(JSON.stringify(query));