Home Notices Documents Classes Download Others Rice
Classes  >  bitbankapi  >  CandleStick(string,string,string)
bitbankapi class : CandleStick(string,string,string) method

Description

Gets the candlestick data of the specified date.

Syntax

bitbankapiInstance.CandleStick(string currencyPair,string candletype, string date)

Arguments

ClassNameDescription
stringcurrencyPairCurrency pair.
stringcandletypePeriod of the candlesticks.
stringdateFormatted date string.

Return value

ClassDescription
bitbankresResponse to request, with JSON-text.

Sample code

1:

bitbankapi bitbankapiIns = new bitbankapi();

2:

bitbankres bitbankresIns = bitbankapiIns.CandleStick("btc_jpy","30min", "20200220");

3:

string jsonStr = bitbankresIns.Result;

Example for JSON-text

{"success":1,"data":{"candlestick":[{"type":"30min","ohlcv":[["1070000","1073587","1067670","1071376","35.4508",1582156800000],["1071376","1074000","1070001","1073003","27.9728",1582158600000],["1073003","1073802","1068776","1070050","23.3190",1582160400000],["1070049","1071728","1066000","1069367","50.4367",1582162200000],["1069367","1069584","1061500","1062660","46.0998",1582164000000],["1062668","1066819","1058000","1066819","55.1355",1582165800000],["1067038","1069022","1065249","1068353","45.7211",1582167600000],["1068509","1068695","1065443","1065801","25.9002",1582169400000],["1065800","1068015","1065800","1066241","26.7266",1582171200000],["1066240","1066556","1064010","1066050","13.4571",1582173000000],["1066251","1066556","1064010","1064259","16.3326",1582174800000],["1064276","1065962","1062653","1065520","17.9602",1582176600000],["1065520","1065990","1064251","1064471","16.2486",1582178400000],["1064471","1072294","1064470","1071683","19.5864",1582180200000],["1071987","1074463","1062000","1073647","47.5354",1582182000000],["1073773","1073999","1071998","1072928","28.1551",1582183800000],["1072798","1073479","1069999","1070534","18.1512",1582185600000],["1070004","1070424","1066572","1069008","39.1463",1582187400000],["1070680","1071912","1068964","1071000","16.3281",1582189200000],["1070540","1075901","1070540","1075729","22.7591",1582191000000],["1075729","1079734","1072676","1078446","20.7065",1582192800000],["1078818","1080000","1076921","1077991","25.1356",1582194600000],["1077989","1079992","1076466","1076892","18.5606",1582196400000],["1076896","1076926","1071200","1071780","21.7210",1582198200000],["1071785","1075360","1071785","1073000","22.9637",1582200000000],["1073001","1073800","1069796","1071315","15.6401",1582201800000],["1071315","1072321","1068000","1069999","31.7010",1582203600000],["1070000","1074625","1068878","1074396","9.4698",1582205400000],["1074300","1077805","1072261","1076992","12.8548",1582207200000],["1076992","1077925","1076992","1077466","6.1864",1582209000000],["1077467","1077467","1073466","1074986","11.5245",1582210800000],["1075315","1076463","1075053","1075680","4.6344",1582212600000],["1075680","1077899","1070600","1071404","16.4015",1582214400000],["1071403","1085000","1056913","1080106","80.2129",1582216200000],["1080106","1081402","1059999","1066398","33.9658",1582218000000],["1066391","1068052","1063480","1065783","18.4583",1582219800000],["1066150","1067963","1062002","1066940","6.1078",1582221600000],["1066940","1072463","1066940","1070158","7.4025",1582223400000],["1070069","1071952","1069560","1070001","3.2761",1582225200000],["1071549","1072963","1069162","1072122","9.6845",1582227000000],["1072698","1072963","1070189","1070507","7.7748",1582228800000],["1071009","1074463","1071008","1073700","2.2496",1582230600000],["1073700","1075000","1073699","1074999","3.1400",1582232400000],["1075000","1078085","1074999","1078085","9.4685",1582234200000],["1078187","1083492","1078148","1080974","19.6718",1582236000000],["1080915","1080915","1076003","1079240","20.0954",1582237800000],["1079444","1079518","1076461","1078222","8.4620",1582239600000],["1078334","1078662","1076670","1077250","11.9104",1582241400000]]}],"timestamp":1582243145830}}

Notes

Public API. API key and secret key are unnecessary.

Valid first argument : btc_jpy, xrp_jpy, ltc_btc, eth_btc, mona_jpy, mona_btc, bcc_jpy, bcc_btc

Valid second argument : 1min, 5min, 15min, 30min, 1hour, 4hour, 8hour, 12hour, 1day, 1week

It specifies a formatted date string to the third argument. The format is "YYYY" or "YYYYMMDD".

The format of the third argument depends on the second argument.

YYYYMMDD : 1min, 5min, 15min, 30min, 1hour

YYYY : 4hour, 8hour, 12hour, 1day, 1week

The date switches at UTC+0. For example, the JST is UTC+9 so it switches at 9am in Japan.

An instance of the bitbankres class is returned as the response to the request. This instance holds the JSON-text of the result of the response.

The ohlcv in the JSON-text is sorted with UNIX timestamp. Sort order is ascend.

If the argument is incorrect, the following JSON-text will be returned.

{"success": 1000,"return": { "message": "http error"}}

If an HTTP error occurs, the following JSON-text will be returned.

{"success": -1000,"error": { "statuscode" : 404, "message": "Not Found"}}

"statuscode" and "message" are different for each HTTP error.

If the request times out, the following JSON-text is returned.

{"success": -1001,"error": { "typename" : "TaskCanceledException", "message": "A task was cancelled."}}

If the request fails due to other exceptions, the following JSON-text will be returned.

{"success": -1002,"error": { "typename" : "...", "message": "..."}}

"typename" and "message" are different for each exception.

Links for reference

Copyright © Rice All rights reserved.