Best Of
I can't find how to get "Total profit/loss" from API for active contracts
Hi.
Please, anybody knows how can I get the actual information of a active contract including the value of "Total profit/loss" that appears in the Deriv Report for the open positions? (attached image).
The API Price Proposal: Open contracts dont have a element for the active profit/loss while the contract is open.
Thanks.
Re: From demo to real acc ??
Hey @NOT_a_reCaptcha,
We've discussed this internally but we will most likely not implement such a feature. An alternative way to tackle this problem is to create some logic that simulates a purchase and tracks whether it was a winning contract or not. Based on that you could then decide to purchase the real money contract or not.
Regards,
Aaron
Re: From demo to real acc ??
Thanks for the answer, as to how would I use it it's something like this
I have this bot i build few months ago and the results it gives aren't bad at all, but they are far from good enough. So what I want to do is to stack chances of wining in my favor by letting the bot trad on demo and wait till it reaches something like 5 or 6 losses in a row and then switch to real acc and trade, after it profits from trading it has made on real acc it should switch back to demo and repeat the process.
Subscribe to the stream that allow get candle every minute
I have a question
I see in the documentation how to subscribe the stream to get ticks but If I want to do the same thing but for candle every minute for example, can I do that? Should I make my own synchronization with server by time?
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
The websocket client often delays receiving the server push tick stream
Hi, I have a problem and want to consult, the scene is as follows:
Request server url: wss://ws.binaryws.com/websockets/v3?app_id=xxx&l=en
Api:https://developers.binary.com/api/#ticks
Business use: The websocket client keeps connecting with the server, and the websocket client sends a ping request every 30s
Question: During use, the Websocket client can always maintain a connection with the server. Normally, the client receives a tick stream from the server every 2s, but it often occurs that the client delays receiving the tick stream, and the delay interval is not fixed. For example If the delay is 12s, then 6 pieces of tick stream data are received at a time at the 12s interval
Re: Trading is suspended due to missing market (old) data.
Hello, have you resolve issue ? I've got the same problem today. Also for "sell" API command.