Proposal Multicontract

some body help me to solve to our code with proposal multiple contract.
we write code like :
{
"proposal": 1,
"amount": "1",
"basis": "stake",
"contract_type": "DIGITDIFF",
"currency": "USD",
"duration": "5",
"duration_unit": "t",
"symbol": "R_100",
"barriers":[{"barrier":1},{"barrier":2}]
}

But response code is :smile:

"error": {
"code": "InputValidationFailed",
"details": {},
"message": "Input validation failed: The property barriers is not defined in the schema and the schema does not allow additional properties"
},

Whats wrong with our code.

Comments

  • The problem is that barriers is not defined as key here https://developers.binary.com/api/#proposal you need to use barrier and barrier2

  • for contract DIGITDIFF only one barrier, so what value for barrier2 because it is not yet.

  • @kazaoo then you don't need to pass it, barrier2 is only used when it's two barrier contract

  • yes, i have try entry code with only one barrier us our coding at first question above. but still error. can you give me sample for digit contract.

    This is our code :

    {
    "proposal": 1,
    "amount": "1",
    "basis": "stake",
    "contract_type": "DIGITDIFF",
    "currency": "USD",
    "duration": "5",
    "duration_unit": "t",
    "symbol": "R_100",
    "barriers":[{"barrier":1},{"barrier":2}]
    }

    What wrong the code ?

  • I have solved the code, at the api playground have miss sample code.
    The true code is :

    {
    "proposal_array": 1,
    "amount": "0.5",
    "basis": "stake",
    "contract_type": "DIGITDIFF",
    "currency": "USD",
    "duration": "5",
    "duration_unit": "t",
    "symbol": "R_100",
    "barriers":[{"barrier":1},{"barrier":2}]
    }

    So, for BUY the contract, what code is used ?

    Buy_Contract

    or

    Buy_Multiple_Account

    Please help me.

  • @Raunak please help me to explain.

  • Please use Buy_Contract for purchasing single contract. Buy_Multiple_Account is used to purchase same contract for multiple accounts

  • @Raunak
    not so mean, I ask is if I use proposal_array, what command should I use to buy the contract.

    We use request proposal_array

    {
    "proposal_array": 1,
    "amount": "0.5",
    "basis": "stake",
    "contract_type": "DIGITDIFF",
    "currency": "USD",
    "duration": "5",
    "duration_unit": "t",
    "symbol": "R_100",
    "barriers":[{"barrier":1},{"barrier":2}]
    }

    So, what command the buy that proposal ?

  • @kazaoo sorry in previous examples it was proposal so guessed that.

    When you send proposal array you get something like this

    {
      "echo_req": {
        "amount": 10,
        "barriers": [
          {
            "barrier": "+23.27",
            "barrier2": "-23.18"
          }
        ],
        "basis": "payout",
        "contract_type": "EXPIRYMISS",
        "currency": "USD",
        "duration": 10,
        "duration_unit": "m",
        "proposal_array": 1,
        "req_id": 8,
        "subscribe": 1,
        "symbol": "R_100"
      },
      "msg_type": "proposal_array",
      "proposal_array": {
        "id": "ae1c6c9f-00fc-e4a1-1363-48cefb5e94bc",
        "proposals": [
          {
            "ask_price": "7.22",
            "barrier": "+23.27",
            "barrier2": "-23.18",
            "date_start": "1490243758",
            "display_value": "7.22",
            "longcode": "Win payout if Volatility 100 Index ends outside entry spot minus 23.18 to entry spot plus 23.27 at 10 minutes after contract start time.",
            "payout": "10",
            "spot": "14146.30",
            "spot_time": "1490243758"
          }
        ]
      },
      "req_id": 8
    }
    

    you can pass the id ("id": "ae1c6c9f-00fc-e4a1-1363-48cefb5e94bc",) in buy call.

    Buy multiple contract is used for purchasing contracts for multiple clients

  • edited March 2017

    Hello @Raunak

    We have try to make case.

    **1. Step One request proposal array **

    {
    "proposal_array": 1,
    "amount": "0.5",
    "basis": "stake",
    "contract_type": "DIGITDIFF",
    "currency": "USD",
    "duration": "5",
    "duration_unit": "t",
    "symbol": "R_100",
    "barriers": [
    {
    "barrier": 1
    },
    {
    "barrier": 2
    }
    ]
    }

    2. Request Have Response

    {
    "echo_req": {
    "amount": "0.5",
    "barriers": [
    {
    "barrier": 1
    },
    {
    "barrier": 2
    }
    ],
    "basis": "stake",
    "contract_type": "DIGITDIFF",
    "currency": "USD",
    "duration": "5",
    "duration_unit": "t",
    "proposal_array": 1,
    "symbol": "R_100"
    },
    "msg_type": "proposal_array",
    "passthrough": {},
    "proposal_array": {
    "id": "861fcd2c-994f-19a9-3021-4bdff8f8cb12",
    "proposals": [
    {
    "ask_price": "0.50",
    "barrier": 1,
    "date_start": "1490344063",
    "display_value": "0.50",
    "longcode": "Win payout if the last digit of Volatility 100 Index is not 1 after 5 ticks.",
    "payout": "0.53",
    "spot": "14024.06",
    "spot_time": "1490344062"
    },
    {
    "ask_price": "0.50",
    "barrier": 2,
    "date_start": "1490344063",
    "display_value": "0.50",
    "longcode": "Win payout if the last digit of Volatility 100 Index is not 2 after 5 ticks.",
    "payout": "0.53",
    "spot": "14024.06",
    "spot_time": "1490344062"
    }
    ]
    }
    }

    3. Make Buy Proposal Request

    {
    "buy": "861fcd2c-994f-19a9-3021-4bdff8f8cb12",
    "price": 0.5

    4. NO respon for this request. Command not have response like transaction id or other. please you try at api playground.

    Regards

  • @Raunak can you have test at api playgorund and fixed it ?

  • @kazaoo thanks for pointing this out. We have fix for this and we will release it in coming week. Sorry for the inconvenience.

  • @Raunak thanks for your attention.
  • @Raunak hallo, have you finished buy multiple contract function ?... please update info to me..

  • @Raunak hello what progress for multiple contract fixed? We waiting for solved.
  • Sorry to inform that its still under development :( as its major architecture change so its taking time

Sign In or Register to comment.