API for check contract results
Hi.
I can't find the correct API for get results (won/lost) of a contract.
Anyone can help me, please?
Thanks.
Hi.
I can't find the correct API for get results (won/lost) of a contract.
Anyone can help me, please?
Thanks.
Comments
Here it is - https://developers.binary.com/api/#transaction
Hi @Fiber100
There is not a field for transaction number/reference like 35849297148 for get the result (win/loss).
Please, can you clarify?
Thanks.
I''m not sure what you asking about, but all info is there:
"contract_id": "17976948048"
"transaction_id": "35877299288"
And to get result (win/loss) look at response
"action": "sell",
"amount": "10.99" <- win
if amount 0 , then loss
When you send a "buy" request the response includes the contract_id, save this number.
When the transaction response comes, check the following fields
A word of warning, sometimes the transaction is delayed. I have seen transactions that arrived several minutes after the close of the contract.
A faster way of getting trade results is to subscribe to Proposal Open Contract
And watch for a response that contains an "exit_tick" field. Then you can check to see whether the exit_tick is in the money.
If the relevant transaction is delayed, you can send Sell Expired.