Help with buy/sell contract
Hello , i would like to know what is the correct json format to perform a trade
i need to know which api to call to perform the trade
what we have so far is a assetlist call that returns the minor pairs, and then we do a call with that pair but the trade does not perform
this is the json we send to the api
{"amount":1,
"basis":"stake",
"contract_type":"PUT",
"currency":"USD",
"duration":1,
"duration_unit":"m",
"symbol":"frxAUDCAD",
"proposal":1,
"subscribe":1}
the api output look like
could you be kind to say what are the missing parameter for perform a trade ?
or could you provide a full sample of your data when you perform a trade ?
i will share some signals to people that help
thanks you very much
Comments
ok i answer to my own question , it might help others..
step 1
{"amount":1,"basis":"stake","contract_type":"PUT","currency":"USD","duration":2,"duration_unit":"m","symbol":"frxAUDCAD","proposal":1,"subscribe":1}
the output give
{
"echo_req": {
"amount": 1,
"basis": "stake",
"contract_type": "PUT",
"currency": "USD",
"duration": 2,
"duration_unit": "m",
"proposal": 1,
"subscribe": 1,
"symbol": "frxAUDCAD"
},
"msg_type": "proposal",
"proposal": {
"ask_price": "1",
"date_start": "1492435862",
"display_value": "1",
"id": "6c1374f9-9a60-a24e-f1a8-7cd053f09456",
"longcode": "Win payout if AUD/CAD is strictly lower than entry spot at 2 minutes after contract start time.",
"payout": "1.87",
"spot": "1.00897",
"spot_time": "1492435862"
}
}
then you just need to use the ID , but i dont get what the price mean here since its already set to 1 (amount parameter)
{
"buy": "6c1374f9-9a60-a24e-f1a8-7cd053f09456",
"price": 100
}
Price that you need to pass that is price at which you want to buy. For example you send proposal call and it returns price as 1 but you didn't send buy request now price changed while proposal is streaming to 0.98 so you need to send this price
thx you Raunak , i will check about that
what does raunak mean?
i dont i understand, can you help
raunak or anyone please explain more?
@Raunak Kindly respond to the comment made above
@pierredemarque Please how can I know the possible values for the parameters (e.g. contract_type, symbol, etc.) because the documentation is not explanatory. For example, the documentation said "contract_type (string) A valid contract-type" without examples/list of "valid" values
Thanks.
The API isn't easy, but it is relatively complete. People aren't going to spoon-feed you, so you need to read the docs and cross reference the info for yourself. For example, you ask about valid contract types... there is an API call called Contracts For Symbol. You ought to have been able to find that on your own.
I said we wouldn't spoon-feed you, but you seem to need a boost so here is roughly what I do...
Another way of finding out whether a contract has been won is to subscribe to the Transactions stream, but there is always a delay between the contract expiry and the resulting payout being added to your account. Sometimes this delay can be several minutes long. The Sell expired contracts call can be used to speed this up when necessary.
@Raunak I assume you are talking about the ask_price of the contract, not the spot price of the underlying market. In which case, your comment isn't relevant, because with basis=stake the ask_price is never going to change. Besides the price you send in the buy request is the maximum you are willing to pay, so sending 1 when the contract only accepts .98 would not be a problem. But maybe I have totally misunderstood your rather cryptic comment.
Maybe someone could write up an API walkthrough explaining (much like I did here) which parts of the API to use, and in what order, in order to place a trade etc.
@jimmytee how do I pin this your wonderfully superb response to the top of the Best of the Best?
Become a general today.Get and learn all my strategys on how I succeed in binary options trade and forex trade using the TAS software and indicators apps /EA get knowledges,be highly profitable,wow make over £79000 get the proofs now and try to see the posiblity results and get reliable sources for managing your account more info contact (kenlynch507@gmail.com).
@jimmytee
hello, please can you tell me, where to find this documentation you spoke of???
@be_Basti I think he was referring to our developer page https://developers.binary.com/