Comments (11)
I still don't get it, are you trying to place trades through the site, via console? i.e. bypass the UI?I'm not sure that will work to be honest.
The site, I think, buys off proposals, which means you need a proposal in order to place the trade. I haven't done this, so I'm not 100%. but I think the string you need is this one:
you need to pass the parameters of your desired trade :
const parameters = {
"proposal": 1,
"amount": "100",
"basis": "stake",
"contract_type": "CALL",
"currency": "USD",
"duration": "30",
"duration_unit": "s",
"barrier": "+0.1",
"symbol": "R_100"
}
I think the function is:
api.getPriceProposalForContract(parameters)
you'll then need to pull the info out:
.then(
(response, reject) => {
//map what you need hereprobably:
let proposal_id =response.proposal.id
}).catch
But I never really looked into it any further as I found buying without a proposal a much better solution. It is probably worth looking through the source code of the webtrader (probably similar to smart trader) to see exactly what they are doing, ormaybe this will help?
https://github.com/binary-com/Binary-WS-endpoint-extension
from binary-live-api.
from binary-live-api.
no solution there
from binary-live-api.
#114 is the solution. i.e. buy without a proposal. Buy without a proposal then use the contract_id to keep track of the trade until it closes. The API is a bit of a jumble as far as I could tell, I've built a trading platform for it and I have had to write workarounds for nearly every part of it.
What is it exactly that you are after? I can try and help :)
from binary-live-api.
This is how I am placing a trade:
const parameters = {
amount: settings.get('stake.stake'), // '0.35'
basis: 'stake', // or 'payout'
contract_type: settings.get('callOrPut.callOrPut'), // or 'CALL / PUT'
currency: settings.get('currency.currency'),
duration: duration, // '5'
duration_unit: duration_unit, //'t'/ 's'/ 'm' etc
symbol: signal, // symbol 'R_100' or frxAUDJPY
};
api.authorize(token).then(function resolve(resp) {
api.buyContractParams(parameters, 2500).then(
(response, reject) => {
console.log(response);
let time = moment().format("kk:mm:ss");
let contract_id = response.buy.contract_id;
let longCode = response.buy.longcode;
let newBalance = response.buy.balance_after;
blah, blah
}).catch // blah blah
from binary-live-api.
#114 is the solution. i.e. buy without a proposal. Buy without a proposal then use the contract_id to keep track of the trade until it closes. The API is a bit of a jumble as far as I could tell, I've built a trading platform for it and I have had to write workarounds for nearly every part of it.
What is it exactly that you are after? I can try and help :)
I want to press purchase button by api and set Durstion ans Stake values
I wrote bot - eur/usd predictor and want to connect it to the binary com. by official api I can only get 1 sec. frame price. and I want to bet
from binary-live-api.
This is how I am placing a trade:
const parameters = { amount: settings.get('stake.stake'), // '0.35' basis: 'stake', // or 'payout' contract_type: settings.get('callOrPut.callOrPut'), // or 'CALL / PUT' currency: settings.get('currency.currency'), duration: duration, // '5' duration_unit: duration_unit, //'t'/ 's'/ 'm' etc symbol: signal, // symbol 'R_100' or frxAUDJPY }; api.authorize(token).then(function resolve(resp) { api.buyContractParams(parameters, 2500).then( (response, reject) => { console.log(response); let time = moment().format("kk:mm:ss"); let contract_id = response.buy.contract_id; let longCode = response.buy.longcode; let newBalance = response.buy.balance_after; blah, blah }).catch // blah blah
thanks. can you write json structure for this request? Im c# developer :-))
from binary-live-api.
I'm not really sure I understand. It sounds like you'd be better off just using something like Kantu to manipulate the DOM and press buttons etc on a macro. If you want to use the official site? Am I missing something?
from binary-live-api.
I'm not really sure I understand. It sounds like you'd be better off just using something like Kantu to manipulate the DOM and press buttons etc on a macro. If you want to use the official site? Am I missing something?
i find the function on the site. and i search api endpoints for same purpose (bet on higher / lower price)
from binary-live-api.
Thanks. it works
from binary-live-api.
Excellent!
from binary-live-api.
Related Issues (20)
- Who can coding for me in python. only login, and trade. buy put call 5 ticks HOT 2
- Options for "Allow equals" in API HOT 2
- Simple trading example HOT 2
- Problem with app markup details HOT 1
- Query about rate limits
- Error: Required is not defined HOT 5
- new app markup call? HOT 3
- How Copy Trade One Account To Multiple accounts ? HOT 1
- Api Get Trading Durations HOT 2
- WebSocket faces many times timeout/disconnection
- Websocket error abortHandshake HOT 3
- Buy Contract for BTC Account HOT 2
- Minimum stake of 0.50 and maximum payout of 100.00
- del please
- Anyone wanting to use the API
- mememulai live api. help Have more questions?
- TypeError: api.cancel is not a function
- [ServerError] Terms and conditions approval is required. HOT 1
- How can I get contract_type from transaction stream? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binary-live-api.