Trading is not offered for this duration.
I'm trying to create a trading application but the problem is when I request a proposal so I can buy a contract, I get the weirdest of errors.
I've tried different Symbols to trade on but all, except for the R_XX ones come back with a similar exception. Currently I am using a virtual account, not sure if that is what is causing the problem because I can do similar trades on the smart trader on the website.
Here's are some of the JSON requests
{ "proposal": 1, "amount": "10", "basis": "stake", "contract_type": "CALL", "currency": "USD", "duration": "5", "duration_unit": "m", "barrier": "+0.00", "symbol": "frxAUDJPY" }
{ "proposal": 1, "amount": "10", "basis": "stake", "contract_type": "PUT", "currency": "USD", "duration": "5", "duration_unit": "m", "barrier": "+0.00", "symbol": "frxXAUUSD" }
And here is the typical response I get:
{"echo_req":{"amount":"10","barrier":"+0.00","basis":"stake","contract_type":"PUT","currency":"USD","duration":"3","duration_unit":"t","product_type":"basic","proposal":1,"symbol":"frxXAUUSD"},"error":{"code":"OfferingsValidationError","message":"Trading is not offered for this duration."},"msg_type":"proposal"}
Comments
Removing the explicit barrier parameter should allow you to create short-term CALL/PUT contracts that use the current spot as the barrier:
I've also raised this with our team internally - a
+0.0
barrier should behave the same way as the default. Thanks for reporting this!Seems to have worked! Thanks a lot!
Hello there, I have a similar problem with starting trades via API.
The error states the same: Trading is not offered for this duration.
I would like my trade to start at the new candle.
One candle is one minute in my case.
So I basically take current time and add needed seconds to fulfill this minute - to the next full minute.
If it is 16:28:28 now, I want my option start at 16:29:00.
My code is:
let time = new Date();
let time_start = time.getTime() + ((60 - time.getSeconds()) * 1000);
ws.send(JSON.stringify({
"proposal": 1,
"amount": 100,
"basis": "stake",
"contract_type": "CALL",
"currency": "USD",
"duration": 60,
"duration_unit": "s",
"symbol": "RDBEAR",
"date_start": Math.ceil(time_start / 1000)
}));
What do I do wrong?
Thanks for helping me.