-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix endlesslop in case of empty response
- Loading branch information
1 parent
c2ba0e9
commit 4b338a4
Showing
6 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 160 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: '' # pick a git hash / tag to point to | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# A simple | ||
|
||
import datetime | ||
|
||
# available future symbols | ||
futures = { | ||
'ADA': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 17}, | ||
'BCH': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 17}, | ||
'EOS': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 17}, | ||
'ETH': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 16}, | ||
'LTC': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 19}, | ||
'TRX': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 17}, | ||
'XBT': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 15}, | ||
'XRP': {'timeframes': ['1m', '5m', '1h', '1d'], 'since_year': 17}, | ||
} | ||
|
||
# F = January | ||
# G = February | ||
# H = March | ||
# J = April | ||
# K = May | ||
# M = June | ||
# N = July | ||
# Q = August | ||
# U = September | ||
# V = October | ||
# X = November | ||
# Z = December | ||
month_codes = ['F', 'G', 'H', 'J', 'K', 'M', 'N', 'Q', 'U', 'V', 'X', 'Z'] | ||
|
||
if __name__ == '__main__': | ||
for symbol, futures_config in futures.items(): | ||
|
||
# current year as two digits | ||
current_year = int(datetime.datetime.now().strftime('%y')) | ||
start_year = futures_config['since_year'] | ||
|
||
while start_year <= current_year: | ||
|
||
for month in month_codes: | ||
print(f'https://www.bitmex.com/api/v1/trade/bucketed?symbol={symbol}{month}{start_year}&binSize=1d') | ||
|
||
# set iteration to next year | ||
start_year = start_year + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters