n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

Functionality of getcandles #60

Closed masalinas closed 7 years ago

masalinas commented 7 years ago

I made some tests with the getcandles API but I don't understand the results. Example:

market: 'BTC-LTC' tickInterval: 'day' starTimestamp: '2017-08-01T00:00:00.000Z'

If I'm not wrong, from starTimestamp to Now (2017-08-25T00:00:00.000Z) exist 25 days so we must obtain 25 candles because I selected 'day' like tickInterval, but I obtain 1266 candles from these dates: 2014-03-07T00:00:00 to 2017-08-25T00:00:00.

This is my code, where market, tickInterval and startTimestamp are variables, I discovered that tickInterval could be: 'oneMin', 'fiveMin', 'thirtyMin, 'hour', 'day'.

startTimestamp is a Date object of course.

// get timestamp time from startTimestamp
var startTimestamp = startTimestamp.getTime()/1000;

// get candles
bittrex.getcandles({ marketName : market, tickInterval: tickInterval, _: startTimestamp}, function( data, err ) {
            if (err) return cb(err);

            cb(null, data);
        });

The result

{
  "success": true,
  "message": "",
  "result": [
    {
      "O": 0.02525,
      "H": 0.0254,
      "L": 0.02525,
      "C": 0.0254,
      "V": 67.44587598,
      "T": "2014-03-07T00:00:00",
      "BV": 1.70412525
    },
   ...
   ...
{
      "O": 0.01152093,
      "H": 0.011788,
      "L": 0.0113416,
      "C": 0.011691,
      "V": 107397.09516801,
      "T": "2017-08-25T00:00:00",
      "BV": 1241.90857854
    }
  ]
}

What is wrong???

Regards

victorabraham commented 7 years ago

Same issue here. Might be an issue at API end. Not sure if we are using right parameter name for startTime. Please try hitting below link directly, https://bittrex.com/Api/v2.0/pub/market/GetTicks?marketName=BTC-LUN&tickInterval=fiveMin&startTime=1503680400

startTime filter does not work at all.

masalinas commented 7 years ago

The attribute startTime not works, only if you change the tickInterval from minute to hour and day the time interval incrise, but the attribute startTime not works, and the problem is that not exist any documentation about this API.

dparlevliet commented 7 years ago

duplicate of #53 and fixed in #55