GithubHelp home page GithubHelp logo

Comments (11)

wilburforce83 avatar wilburforce83 commented on August 18, 2024 1

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:

image

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.

wilburforce83 avatar wilburforce83 commented on August 18, 2024

#114

from binary-live-api.

paramon161616 avatar paramon161616 commented on August 18, 2024

#114

no solution there

from binary-live-api.

wilburforce83 avatar wilburforce83 commented on August 18, 2024

#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.

wilburforce83 avatar wilburforce83 commented on August 18, 2024

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.

paramon161616 avatar paramon161616 commented on August 18, 2024

#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

image

from binary-live-api.

paramon161616 avatar paramon161616 commented on August 18, 2024

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.

wilburforce83 avatar wilburforce83 commented on August 18, 2024

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.

paramon161616 avatar paramon161616 commented on August 18, 2024

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.

paramon161616 avatar paramon161616 commented on August 18, 2024

Thanks. it works

from binary-live-api.

wilburforce83 avatar wilburforce83 commented on August 18, 2024

Excellent!

from binary-live-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.