charlion Posted February 13, 2021 Share Posted February 13, 2021 Hi everyone. I'm very new into self learning programming. Presently I'm trying to develop a simple basic Robot that would only Place a Market Order every seconds and it will cancel the Order every followed seconds. Using the following library:https://docs.b2bx.exchange/en/_docs/api-reference.html#private-api It would place Trade Order at a ( Price = ex.com api * Binance api Aggregate Trades Price) I have already wrote the api to call for xe.com exchange rate with php <?php $auth = base64_encode("username:password"); $context = stream_context_create([ "http" => [ "header" => "Authorization: Basic $auth" ] ]); $homepage = file_get_contents("https://xecdapi.xe.com/v1/convert_from?to=NGN&amount=1.195", false, $context ); $json = json_decode($homepage, TRUE); foreach ($json as $k=>$to){ echo $k; // etc }; ?> And also for the Binance Aggregate Price in JavaScript <script> var burl = "https://api3.binance.com"; var query = '/api/v3/aggTrades'; query += '?symbol=BTCUSDT'; var url = burl + query; var ourRequest = new XMLHttpRequest(); ourRequest.open('GET',url,true); ourRequest.onload = function(){ console.log(ourRequest.responseText); } ourRequest.send(); </script> My problem is how to handle these two api responds and also the functions to use them to place a trade and cancel it. Please help me out. Thanks in advance on any help. Quote Link to comment https://forums.phpfreaks.com/topic/312143-crypto-market-order-functions-that-create-and-cancel-order-with-php-and-javascript/ Share on other sites More sharing options...
gizmola Posted February 17, 2021 Share Posted February 17, 2021 I removed the apikeys from your message. Keep in mind this is a public forum, spidered by google. Even if those are development keys, you don't want to publish them to the world. Quote Link to comment https://forums.phpfreaks.com/topic/312143-crypto-market-order-functions-that-create-and-cancel-order-with-php-and-javascript/#findComment-1584558 Share on other sites More sharing options...
Wasquez Posted February 17, 2021 Share Posted February 17, 2021 (edited) This pretty interesting, not going to lie. I'm too technically impaired to understand what's happening in the source code, but I still understand some things about the crypto market. I use tools to help me nevigate through what's happening, like investous is my favorite right now cause it's the one that lets me best understand the way the whole stuff works. I'm pretty happy with the few hudred bucks I was able to make on my own, cause my kids laughed at me when I told them about me starting in crypto. Guess I can laugh at them now, cause I made more than they ever did by investing, haha. Edited February 17, 2021 by Barand spammy link removed Quote Link to comment https://forums.phpfreaks.com/topic/312143-crypto-market-order-functions-that-create-and-cancel-order-with-php-and-javascript/#findComment-1584577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.