API portfolio empty?

edited March 2018 in General

Hello.

I am developing a desktop trader bot for a client. I need the same functionality as in the web interface - exactly 1:1, but achieved through the API.
To the best of my understanding, the website is all about buying available contracts but the web interface is a set of options built on the fly on the available contracts that are hidden from the user - so one selects the set of options and the platform decides on which contract should be purchased.
Unfortunately, I am unable to find a good explanation on how this works in details - so it will be great if there is one. As inconvenient as this is it's not the problem - it can be figured out, and I think I've developed a quite good understanding of the process after some effort and frustration.

The only function I see to buy a contract is "Buy Contract" that needs contract ID that can be retrieved from "Price Proposal" that is used to retrieve the actual price for values within the contract boundaries, which id is retrieved by the "Portfolio" function which returns an empty array for contracts in my case.

{
"echo_req": {
"portfolio": 1
},
"msg_type": "portfolio",
"portfolio": {
"contracts": [

]

}
}

Also, by calling "Price Proposal - open contract" without contract id that supposedly should return all available contracts it returns none.

{
"echo_req": {
"proposal_open_contract": 1,
"subscribe": 1
},
"msg_type": "proposal_open_contract",
"proposal_open_contract": {}
}

So why is that?

Also, why the API doesn't facilitate the functionality of the website or am I missing something?

Comments

Sign In or Register to comment.