mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-19 07:26:49 +00:00
kline/exchanges: automatic creation of unsupported candle intervals (#1091)
* kline: Add builder and testing * Ideas * kline: deploy builder functionality across GCT * exchanges: implement across gct * exchanges: Add tests and fix implementations before kline package testing and veri. * kline: Add tests and start to fix ConvertToNewInterval * kline: fix ConvertToNewInterval add tests * kline: complete overarching tests now on to exchanges * kline: finish exchange tests and implement limits * exchanges: more fixes * linter: fix * engine: fix tests * kraken: fix recent trades and other fixes * zb: fix tests * bithumb: fix empty insertion * kline: refactor/optimize CreateKline function * kline: remove the mooos! * kline: prealloc CalculateCandleDateRanges * linter: fix * exchanges: prealloc extended * fix whoopsie * reverse fix because this is a whoopsie * okx: fix risidual issues * linter: fix * kline: initial nits from @gloriouscode * kline: rename builder -> request and cascade change * linter: fix + test * kline: update forced alignment on start and end times when CreateKlineRequest is called. * nits: more more more * NITS: Addressed * tests: fix race issue * Update exchanges/kline/request.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * kline: add method AddPadding() to automatically fill in holes in kline.Request functionality and reject if missing data when converting * kline: Add params start and end to addPadding() to insert blanks in between block * kline: remove test comment code as it's not needed anymore * kline: fix lint and test * kline: sort slice without extra bool check every iteration * okx: fix issues with timeing and candles and such from niterinos & address typo * Update exchanges/kline/kline.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: niterinos * Update exchanges/poloniex/poloniex_wrapper.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits now onto conflicts YAYA!!! * Update exchanges/exchange_test.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits again * thrasher: nitters * thrasher: niterinos - adds partial flag for incomplete recent candles and fetching. * kline: rm fmtizzle packageizzle * glorious: nitters * glorious: more niterinos * fix last niterinos Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
4
testdata/configtest.json
vendored
4
testdata/configtest.json
vendored
File diff suppressed because one or more lines are too long
5131
testdata/http_mock/binance/binance.json
vendored
5131
testdata/http_mock/binance/binance.json
vendored
File diff suppressed because it is too large
Load Diff
458
testdata/http_mock/poloniex/poloniex.json
vendored
458
testdata/http_mock/poloniex/poloniex.json
vendored
@@ -6780,143 +6780,6 @@
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"close": 0.00518763,
|
||||
"date": 1588741200,
|
||||
"high": 0.00518763,
|
||||
"low": 0.005187,
|
||||
"open": 0.00518701,
|
||||
"quoteVolume": 25.95091903,
|
||||
"volume": 0.13460756,
|
||||
"weightedAverage": 0.005187
|
||||
},
|
||||
{
|
||||
"close": 0.00518401,
|
||||
"date": 1588741500,
|
||||
"high": 0.00518818,
|
||||
"low": 0.00518401,
|
||||
"open": 0.00518818,
|
||||
"quoteVolume": 65.00109374,
|
||||
"volume": 0.33723736,
|
||||
"weightedAverage": 0.00518817
|
||||
},
|
||||
{
|
||||
"close": 0.0051839,
|
||||
"date": 1588741800,
|
||||
"high": 0.00518444,
|
||||
"low": 0.0051839,
|
||||
"open": 0.00518444,
|
||||
"quoteVolume": 0.43601529,
|
||||
"volume": 0.00226025,
|
||||
"weightedAverage": 0.0051839
|
||||
},
|
||||
{
|
||||
"close": 0.00518201,
|
||||
"date": 1588742100,
|
||||
"high": 0.00518614,
|
||||
"low": 0.00518201,
|
||||
"open": 0.00518401,
|
||||
"quoteVolume": 90.59918563,
|
||||
"volume": 0.46972322,
|
||||
"weightedAverage": 0.00518462
|
||||
},
|
||||
{
|
||||
"close": 0.00518373,
|
||||
"date": 1588742400,
|
||||
"high": 0.0051847,
|
||||
"low": 0.00517971,
|
||||
"open": 0.00517972,
|
||||
"quoteVolume": 8.6152343,
|
||||
"volume": 0.04465903,
|
||||
"weightedAverage": 0.00518372
|
||||
},
|
||||
{
|
||||
"close": 0.00519266,
|
||||
"date": 1588742700,
|
||||
"high": 0.00519266,
|
||||
"low": 0.00518553,
|
||||
"open": 0.00518553,
|
||||
"quoteVolume": 81.37365353,
|
||||
"volume": 0.42217513,
|
||||
"weightedAverage": 0.0051881
|
||||
},
|
||||
{
|
||||
"close": 0.00519104,
|
||||
"date": 1588743000,
|
||||
"high": 0.00519597,
|
||||
"low": 0.00519104,
|
||||
"open": 0.00519597,
|
||||
"quoteVolume": 1.10021375,
|
||||
"volume": 0.0057163,
|
||||
"weightedAverage": 0.00519562
|
||||
},
|
||||
{
|
||||
"close": 0.00518988,
|
||||
"date": 1588743300,
|
||||
"high": 0.00518988,
|
||||
"low": 0.00518905,
|
||||
"open": 0.00518905,
|
||||
"quoteVolume": 0.00086904,
|
||||
"volume": 0.0000045,
|
||||
"weightedAverage": 0.00518961
|
||||
},
|
||||
{
|
||||
"close": 0.00519395,
|
||||
"date": 1588743600,
|
||||
"high": 0.00519395,
|
||||
"low": 0.00518901,
|
||||
"open": 0.00518903,
|
||||
"quoteVolume": 0.03395903,
|
||||
"volume": 0.0001763,
|
||||
"weightedAverage": 0.00519181
|
||||
},
|
||||
{
|
||||
"close": 0.00519098,
|
||||
"date": 1588743900,
|
||||
"high": 0.00519526,
|
||||
"low": 0.00519098,
|
||||
"open": 0.00519126,
|
||||
"quoteVolume": 209.14700529,
|
||||
"volume": 1.08631528,
|
||||
"weightedAverage": 0.00519402
|
||||
},
|
||||
{
|
||||
"close": 0.00518534,
|
||||
"date": 1588744200,
|
||||
"high": 0.00519198,
|
||||
"low": 0.00518534,
|
||||
"open": 0.00519179,
|
||||
"quoteVolume": 176.01313731,
|
||||
"volume": 0.91303131,
|
||||
"weightedAverage": 0.00518729
|
||||
},
|
||||
{
|
||||
"close": 0.00518573,
|
||||
"date": 1588744500,
|
||||
"high": 0.00518752,
|
||||
"low": 0.00518572,
|
||||
"open": 0.00518752,
|
||||
"quoteVolume": 97.1672869,
|
||||
"volume": 0.50399966,
|
||||
"weightedAverage": 0.00518692
|
||||
},
|
||||
{
|
||||
"close": 0.00518864,
|
||||
"date": 1588744800,
|
||||
"high": 0.00519153,
|
||||
"low": 0.00518657,
|
||||
"open": 0.00518826,
|
||||
"quoteVolume": 74.95742178,
|
||||
"volume": 0.38903394,
|
||||
"weightedAverage": 0.00519006
|
||||
}
|
||||
],
|
||||
"queryString": "command=returnChartData\u0026currencyPair=BTC_LTC\u0026end=1588745003\u0026period=300\u0026start=1588741200",
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"error": "Invalid currency pair."
|
||||
@@ -19940,6 +19803,327 @@
|
||||
"queryString": "command=returnCurrencies\u0026includeMultiChainCurrencies=true",
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"close": "0.005187",
|
||||
"date": "1588741200000",
|
||||
"high": "0.005187",
|
||||
"low": "0.005187",
|
||||
"open": "0.005187",
|
||||
"quoteVolume": "0.134607560000000000",
|
||||
"volume": "25.950919030000000000",
|
||||
"weightedAverage": "0.005187000000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005184",
|
||||
"date": "1588741500000",
|
||||
"high": "0.005188",
|
||||
"low": "0.005184",
|
||||
"open": "0.005188",
|
||||
"quoteVolume": "0.337237360000000000",
|
||||
"volume": "65.001093740000000000",
|
||||
"weightedAverage": "0.005188170000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005183",
|
||||
"date": "1588741800000",
|
||||
"high": "0.005184",
|
||||
"low": "0.005183",
|
||||
"open": "0.005184",
|
||||
"quoteVolume": "0.002260250000000000",
|
||||
"volume": "0.436015290000000000",
|
||||
"weightedAverage": "0.005183900000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005182",
|
||||
"date": "1588742100000",
|
||||
"high": "0.005186",
|
||||
"low": "0.005182",
|
||||
"open": "0.005184",
|
||||
"quoteVolume": "0.469723220000000000",
|
||||
"volume": "90.599185630000000000",
|
||||
"weightedAverage": "0.005184620000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005183",
|
||||
"date": "1588742400000",
|
||||
"high": "0.005184",
|
||||
"low": "0.005179",
|
||||
"open": "0.005179",
|
||||
"quoteVolume": "0.044659030000000000",
|
||||
"volume": "8.615234300000000000",
|
||||
"weightedAverage": "0.005183720000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005192",
|
||||
"date": "1588742700000",
|
||||
"high": "0.005192",
|
||||
"low": "0.005185",
|
||||
"open": "0.005185",
|
||||
"quoteVolume": "0.422175130000000000",
|
||||
"volume": "81.373653530000000000",
|
||||
"weightedAverage": "0.005188100000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005191",
|
||||
"date": "1588743000000",
|
||||
"high": "0.005195",
|
||||
"low": "0.005191",
|
||||
"open": "0.005195",
|
||||
"quoteVolume": "0.005716300000000000",
|
||||
"volume": "1.100213750000000000",
|
||||
"weightedAverage": "0.005195620000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005189",
|
||||
"date": "1588743300000",
|
||||
"high": "0.005189",
|
||||
"low": "0.005189",
|
||||
"open": "0.005189",
|
||||
"quoteVolume": "0.000004500000000000",
|
||||
"volume": "0.000869040000000000",
|
||||
"weightedAverage": "0.005189610000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005193",
|
||||
"date": "1588743600000",
|
||||
"high": "0.005193",
|
||||
"low": "0.005189",
|
||||
"open": "0.005189",
|
||||
"quoteVolume": "0.000176300000000000",
|
||||
"volume": "0.033959030000000000",
|
||||
"weightedAverage": "0.005191810000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005190",
|
||||
"date": "1588743900000",
|
||||
"high": "0.005195",
|
||||
"low": "0.005190",
|
||||
"open": "0.005191",
|
||||
"quoteVolume": "1.086315280000000000",
|
||||
"volume": "209.147005290000000000",
|
||||
"weightedAverage": "0.005194020000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005185",
|
||||
"date": "1588744200000",
|
||||
"high": "0.005191",
|
||||
"low": "0.005185",
|
||||
"open": "0.005191",
|
||||
"quoteVolume": "0.913031310000000000",
|
||||
"volume": "176.013137310000000000",
|
||||
"weightedAverage": "0.005187290000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005185",
|
||||
"date": "1588744500000",
|
||||
"high": "0.005187",
|
||||
"low": "0.005185",
|
||||
"open": "0.005187",
|
||||
"quoteVolume": "0.503999660000000000",
|
||||
"volume": "97.167286900000000000",
|
||||
"weightedAverage": "0.005186920000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005188",
|
||||
"date": "1588744800000",
|
||||
"high": "0.005191",
|
||||
"low": "0.005186",
|
||||
"open": "0.005188",
|
||||
"quoteVolume": "0.389033940000000000",
|
||||
"volume": "74.957421780000000000",
|
||||
"weightedAverage": "0.005190060000000000"
|
||||
}
|
||||
],
|
||||
"queryString": "command=returnChartData\u0026currencyPair=BTC_LTC\u0026end=1588745003\u0026period=300\u0026start=1588741200",
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"close": "0.005192",
|
||||
"date": "1588741200000",
|
||||
"high": "0.005192",
|
||||
"low": "0.005179",
|
||||
"open": "0.005187",
|
||||
"quoteVolume": "1.410662590000000000",
|
||||
"volume": "271.976101520000000000",
|
||||
"weightedAverage": "0.005186710000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005185",
|
||||
"date": "1588743000000",
|
||||
"high": "0.005195",
|
||||
"low": "0.005185",
|
||||
"open": "0.005195",
|
||||
"quoteVolume": "2.509243380000000000",
|
||||
"volume": "483.462471320000000000",
|
||||
"weightedAverage": "0.005190150000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005190",
|
||||
"date": "1588744800000",
|
||||
"high": "0.005192",
|
||||
"low": "0.005185",
|
||||
"open": "0.005188",
|
||||
"quoteVolume": "1.503792520000000000",
|
||||
"volume": "289.807027890000000000",
|
||||
"weightedAverage": "0.005188940000000000"
|
||||
}
|
||||
],
|
||||
"queryString": "command=returnChartData\u0026currencyPair=BTC_LTC\u0026end=1588745003\u0026period=1800\u0026start=1588741200",
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"close": "0.005187",
|
||||
"date": "1588741200000",
|
||||
"high": "0.005187",
|
||||
"low": "0.005187",
|
||||
"open": "0.005187",
|
||||
"quoteVolume": "0.134607560000000000",
|
||||
"volume": "25.950919030000000000",
|
||||
"weightedAverage": "0.005187000000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005184",
|
||||
"date": "1588741500000",
|
||||
"high": "0.005188",
|
||||
"low": "0.005184",
|
||||
"open": "0.005188",
|
||||
"quoteVolume": "0.337237360000000000",
|
||||
"volume": "65.001093740000000000",
|
||||
"weightedAverage": "0.005188170000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005183",
|
||||
"date": "1588741800000",
|
||||
"high": "0.005184",
|
||||
"low": "0.005183",
|
||||
"open": "0.005184",
|
||||
"quoteVolume": "0.002260250000000000",
|
||||
"volume": "0.436015290000000000",
|
||||
"weightedAverage": "0.005183900000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005182",
|
||||
"date": "1588742100000",
|
||||
"high": "0.005186",
|
||||
"low": "0.005182",
|
||||
"open": "0.005184",
|
||||
"quoteVolume": "0.469723220000000000",
|
||||
"volume": "90.599185630000000000",
|
||||
"weightedAverage": "0.005184620000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005183",
|
||||
"date": "1588742400000",
|
||||
"high": "0.005184",
|
||||
"low": "0.005179",
|
||||
"open": "0.005179",
|
||||
"quoteVolume": "0.044659030000000000",
|
||||
"volume": "8.615234300000000000",
|
||||
"weightedAverage": "0.005183720000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005192",
|
||||
"date": "1588742700000",
|
||||
"high": "0.005192",
|
||||
"low": "0.005185",
|
||||
"open": "0.005185",
|
||||
"quoteVolume": "0.422175130000000000",
|
||||
"volume": "81.373653530000000000",
|
||||
"weightedAverage": "0.005188100000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005191",
|
||||
"date": "1588743000000",
|
||||
"high": "0.005195",
|
||||
"low": "0.005191",
|
||||
"open": "0.005195",
|
||||
"quoteVolume": "0.005716300000000000",
|
||||
"volume": "1.100213750000000000",
|
||||
"weightedAverage": "0.005195620000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005189",
|
||||
"date": "1588743300000",
|
||||
"high": "0.005189",
|
||||
"low": "0.005189",
|
||||
"open": "0.005189",
|
||||
"quoteVolume": "0.000004500000000000",
|
||||
"volume": "0.000869040000000000",
|
||||
"weightedAverage": "0.005189610000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005193",
|
||||
"date": "1588743600000",
|
||||
"high": "0.005193",
|
||||
"low": "0.005189",
|
||||
"open": "0.005189",
|
||||
"quoteVolume": "0.000176300000000000",
|
||||
"volume": "0.033959030000000000",
|
||||
"weightedAverage": "0.005191810000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005190",
|
||||
"date": "1588743900000",
|
||||
"high": "0.005195",
|
||||
"low": "0.005190",
|
||||
"open": "0.005191",
|
||||
"quoteVolume": "1.086315280000000000",
|
||||
"volume": "209.147005290000000000",
|
||||
"weightedAverage": "0.005194020000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005185",
|
||||
"date": "1588744200000",
|
||||
"high": "0.005191",
|
||||
"low": "0.005185",
|
||||
"open": "0.005191",
|
||||
"quoteVolume": "0.913031310000000000",
|
||||
"volume": "176.013137310000000000",
|
||||
"weightedAverage": "0.005187290000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005185",
|
||||
"date": "1588744500000",
|
||||
"high": "0.005187",
|
||||
"low": "0.005185",
|
||||
"open": "0.005187",
|
||||
"quoteVolume": "0.503999660000000000",
|
||||
"volume": "97.167286900000000000",
|
||||
"weightedAverage": "0.005186920000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005188",
|
||||
"date": "1588744800000",
|
||||
"high": "0.005191",
|
||||
"low": "0.005186",
|
||||
"open": "0.005188",
|
||||
"quoteVolume": "0.389033940000000000",
|
||||
"volume": "74.957421780000000000",
|
||||
"weightedAverage": "0.005190060000000000"
|
||||
},
|
||||
{
|
||||
"close": "0.005186",
|
||||
"date": "1588745100000",
|
||||
"high": "0.005188",
|
||||
"low": "0.005185",
|
||||
"open": "0.005185",
|
||||
"quoteVolume": "0.535108970000000000",
|
||||
"volume": "103.162198930000000000",
|
||||
"weightedAverage": "0.005187060000000000"
|
||||
}
|
||||
],
|
||||
"queryString": "command=returnChartData\u0026currencyPair=BTC_LTC\u0026end=1588745100\u0026period=300\u0026start=1588741200",
|
||||
"bodyParams": "",
|
||||
"headers": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user