Git Product home page Git Product logo

bitmex-api-php's Introduction

bitmex-api-php

BitMex PHP REST API with HTTP Keep-Alive support

Get API keys from https://www.bitmex.com/app/apiKeys

HTTP Keep-Alive: BitMex says that "When using HTTP Keep-Alive, request/response round-trip time will be identical to Websocket"

Usage Example

<?php
require_once ("BitMex.php");

$key = "xxxxxxxxxxxxxxxxxxxxxx";
$secret = "yyyyyyyyyyyyyyyyyyyyyy";

$bitmex = new BitMex($key,$secret);

var_dump($bitmex->createOrder("Limit","Sell",50000,1000));
?>

Donations

Your BitCoin donations are highly appreciated at 1N36HHos4qQ76PX1BrmeaJCzWDmggreuNU

bitmex-api-php's People

Contributors

nmind-zz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitmex-api-php's Issues

No Market order Function

Why doesn't this have a market order function? I tried executing a limit order by getting the last price with ticker by that doesn't immediately execute every time.

Can we send bulk orders in one request

`public function createOrder($type,$side,$price,$quantity,$maker = false) {

    $symbol = self::SYMBOL;
    $data['method'] = "POST";
    $data['function'] = "order/bulk";
    $data['params'] = array(
        "symbol" => $symbol,
        "side" => $side,
        "price" => $price,
        "orderQty" => $quantity,
        "ordType" => $type
    );

    if($maker) {
        $data['params']['execInst'] = "ParticipateDoNotInitiate";
    }
    return $this->authQuery($data);
}`

connection issue

Hi ty for ur work.
I can't connect with bitmex testnet.

in bitmex.php

class BitMex {

const API_URL = 'https://testnet.bitmex.com';
//const API_URL = 'https://www.bitmex.com';
const API_PATH = '/api/v1/';
const SYMBOL = 'XBTUSD';

in index.php

getOrders($symbol, $type, $side, $amount, $price); print_r($bitmex) ?>

I receved this message:

BitMex Object ( [apiKey:BitMex:private] => z1oduHSiFGR99iikY24lA2KB [apiSecret:BitMex:private] => mysecret [ch:BitMex:private] => Resource id #2 [error] => 1 [printErrors] => [errorCode] => HTTPError [errorMessage] => Access Denied [proxy] => )

What's wrong?
ty for ur help

How to cancel the order by using "Filter" through Bitmex API

Hello.,

We are trying to cancel the all of the Long or short orders but when I execute the Cancel all order function it canceled the Both Long and Short order, so I used a filter to cancel any one of long or short order but that code is not working.

In Bitmex API explorer we can able to run the canceling Short/Long orders but when i do the same with PHP code it's not working.

public function cancelAllOpenOrders($filter,$text = "") {

$symbol = self::SYMBOL;
$data['method'] = "DELETE";
$data['function'] = "order/all";
$data['params'] = array(
  "symbol" => $symbol,
  "filter" => $filter,
  "text" => $text
);

return $this->authQuery($data);

}

this is the code I used to cancel the order but it canceled all of the short and long orders but I want to cancel anyone of it.

Errors

EDIT: Sorry , it was on my side :P

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.