Skip to content

Commit

Permalink
added until parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
dgg1dbg committed Mar 15, 2023
1 parent bed39e4 commit 1c1c765
Showing 4 changed files with 4 additions and 76 deletions.
75 changes: 0 additions & 75 deletions BTC-USDT: from 2022-11-24T00:00:00Z.csv
Original file line number Diff line number Diff line change
@@ -551,78 +551,3 @@ datetime,open,high,low,close,volume,high_5_sma,high_5_mstd,vwma_5,boll,boll_ub,b
2023-02-23 16:00:00,23940.0,24047.4,23711.5,23962.2,126451.88,24369.879999999997,228.96762216548683,24031.938061739173,24366.825,25210.714014591213,23522.93598540879,0
2023-02-23 20:00:00,23962.3,24061.6,23750.0,23928.8,60199.023,24264.6,224.58045329039155,23963.869600534395,24316.035,25135.425742275424,23496.644257724576,-1
2023-02-24 00:00:00,23928.7,24138.6,23879.0,23945.1,59502.415,24189.120000000003,177.435486868096,23930.997103966998,24269.364999999998,25059.67736536097,23479.052634639025,-1
2023-02-24 04:00:00,23945.1,23974.6,23754.0,23821.5,55400.746,24087.44,92.04981260230151,23914.304980563025,24217.945,24982.626097548327,23453.263902451672,0
2023-02-24 08:00:00,23821.6,23970.0,23741.5,23876.4,60283.249,24038.44,69.6567871791336,23905.222545580287,24165.455,24866.94596096538,23463.964039034625,0
2023-02-24 12:00:00,23876.3,24029.3,23310.5,23337.2,231721.267,24034.82,69.54496387316004,23732.97902083213,24082.085,24759.581370237174,23404.588629762824,0
2023-02-24 16:00:00,23337.1,23339.3,22800.0,23172.3,235087.972,23890.359999999997,315.44946187958647,23485.684622979108,24012.07,24761.71105122688,23262.42894877312,-1
2023-02-24 20:00:00,23172.3,23333.0,22966.0,23175.6,89582.293,23729.239999999998,359.60473161531525,23397.599259482082,23943.15,24735.257476758787,23151.042523241216,-1
2023-02-25 00:00:00,23175.5,23210.5,23032.0,23064.9,32612.85,23576.420000000002,390.31466408543434,23344.17101207599,23866.010000000002,24685.637319418507,23046.382680581497,-1
2023-02-25 04:00:00,23064.9,23119.1,23010.1,23108.7,26914.175,23406.239999999998,360.143149317224,23281.852094185502,23799.275,24638.079349247255,22960.470650752748,-1
2023-02-25 08:00:00,23108.7,23147.6,22897.4,22974.0,59947.25,23229.9,102.49909755764108,23100.069704339552,23738.034999999996,24631.109800368336,22844.960199631656,-1
2023-02-25 12:00:00,22973.9,23075.0,22845.6,22996.4,61274.986,23177.04,100.09871627614179,23067.814259537357,23684.875,24622.80284567072,22746.94715432928,0
2023-02-25 16:00:00,22996.4,23078.7,22905.0,22975.7,46659.541,23126.18,55.88503377588784,23015.51811653253,23625.84,24587.144682299444,22664.535317700556,0
2023-02-25 20:00:00,22975.7,23176.1,22700.0,23146.2,83386.846,23119.299999999996,43.69788324544074,23002.901216350165,23597.760000000002,24581.530849227493,22613.98915077251,0
2023-02-26 00:00:00,23146.2,23243.2,23050.0,23201.8,38352.322,23144.120000000003,70.54967753386171,23017.267078299163,23568.765,24563.827584173156,22573.702415826843,0
2023-02-26 04:00:00,23201.8,23217.8,23077.2,23142.7,31491.179,23158.159999999996,78.00649332031034,23035.287305266887,23517.335,24487.28262804916,22547.387371950837,0
2023-02-26 08:00:00,23142.8,23286.5,23102.8,23244.2,42192.201,23200.46,78.97653449051134,23081.87580408311,23457.329999999998,24329.365612744703,22585.294387255293,1
2023-02-26 12:00:00,23244.2,23332.4,23115.4,23239.7,63502.842,23251.2,60.53738514447212,23135.19284237644,23401.05,24164.93529725916,22637.16470274084,1
2023-02-26 16:00:00,23239.8,23533.0,23130.0,23491.0,93742.282,23322.58,125.45398359609246,23261.602541126565,23387.219999999998,24132.96304478312,22641.476955216876,1
2023-02-26 20:00:00,23491.0,23675.0,23310.0,23545.3,102114.23,23408.940000000002,189.44869490214697,23348.918838599435,23367.484999999997,24071.34868678831,22663.621313211683,1
2023-02-27 00:00:00,23545.2,23634.9,23424.4,23541.0,47678.291,23492.36,175.56492531290135,23392.416376207795,23346.425,23998.678660295373,22694.171339704626,1
2023-02-27 04:00:00,23541.0,23547.0,23331.0,23411.1,53778.498,23544.46,132.5964856250839,23419.167899527787,23320.54,23913.913411853806,22727.166588146196,1
2023-02-27 08:00:00,23411.1,23445.9,23320.0,23420.0,46822.503,23567.16,90.13253019927053,23450.981106249343,23294.285,23813.082724602682,22775.487275397318,0
2023-02-27 12:00:00,23419.9,23888.0,23369.1,23546.5,184987.748,23638.16,165.12259990721984,23529.085342929106,23280.535,23753.00736076251,22808.06263923749,1
2023-02-27 16:00:00,23546.5,23603.9,23140.0,23262.5,166667.763,23623.94,164.21587316736566,23468.414795907418,23249.84,23630.080817876296,22869.599182123704,0
2023-02-27 20:00:00,23262.5,23580.0,23088.0,23480.0,76820.163,23612.96,165.13268301617558,23450.105241790323,23256.980000000003,23649.298853136843,22864.661146863164,0
2023-02-28 00:00:00,23480.0,23539.0,23336.0,23454.3,44084.232,23611.36,165.96819876145193,23451.623472937245,23271.079999999998,23670.785199787453,22871.374800212543,0
2023-02-28 04:00:00,23454.3,23456.2,23210.0,23223.3,44074.367,23613.420000000002,163.44583812419594,23443.49438991767,23273.465,23671.33641681211,22875.59358318789,0
2023-02-28 08:00:00,23223.4,23420.0,23190.2,23381.6,51908.37,23519.82,79.16831436960469,23352.15474108105,23289.3,23677.307536552245,22901.292463447753,-1
2023-02-28 12:00:00,23381.5,23571.1,23300.5,23511.2,126298.911,23513.260000000002,71.44143055765818,23400.29184371083,23309.425,23699.73788865847,22919.11211134153,0
2023-02-28 16:00:00,23511.1,23592.8,23195.1,23251.0,90462.656,23515.82,74.59076350410042,23390.398361954696,23323.275,23681.83992255169,22964.71007744831,0
2023-02-28 20:00:00,23251.1,23333.4,23010.0,23129.6,100091.302,23474.7,107.86635249291423,23328.34526075874,23329.935,23667.254915464106,22992.615084535897,-1
2023-03-01 00:00:00,23129.7,23488.2,23008.4,23431.6,94869.432,23481.1,107.44277546734094,23327.495950214776,23352.73,23648.289609091982,23057.170390908017,0
2023-03-01 04:00:00,23431.6,23852.6,23414.8,23709.6,119744.837,23567.62,189.09408240376752,23401.883940393058,23380.9,23700.033405532242,23061.76659446776,1
2023-03-01 08:00:00,23709.6,24022.7,23670.3,23736.8,87997.318,23657.94,278.0842821881887,23459.57121894514,23407.65,23752.246138904167,23063.053861095836,1
2023-03-01 12:00:00,23736.9,23880.0,23558.0,23702.8,137452.515,23715.379999999997,290.64330716553286,23543.183656806646,23435.655,23780.62648303237,23090.683516967627,1
2023-03-01 16:00:00,23702.9,23739.0,23316.3,23342.9,97637.359,23796.5,199.77552402663395,23600.943213898376,23440.590000000004,23776.740554616103,23104.439445383905,1
2023-03-01 20:00:00,23342.8,23667.5,23281.6,23619.8,79548.85,23832.359999999997,136.75109871630008,23642.01591642113,23459.595,23790.867605028543,23128.32239497146,0
2023-03-02 00:00:00,23619.8,23790.5,23414.1,23487.1,66503.537,23819.94,137.27233151700867,23626.607408204545,23459.4,23790.599351639776,23128.200648360227,0
2023-03-02 04:00:00,23487.1,23535.9,23325.0,23381.9,49671.496,23722.58,129.94905540294434,23564.679320738338,23451.230000000003,23781.567709816194,23120.892290183812,-1
2023-03-02 08:00:00,23381.8,23460.0,23326.3,23405.6,48950.758,23638.58,138.23370428415618,23480.946157648264,23444.46,23772.593813526186,23116.326186473812,-1
2023-03-02 12:00:00,23405.7,23422.8,23183.0,23350.3,124403.213,23575.340000000004,152.40945836830878,23430.194943771203,23441.42,23771.97278486081,23110.867215139187,0
2023-03-02 16:00:00,23350.3,23497.0,23222.1,23456.6,77176.896,23541.24,145.55429571167664,23402.010590147194,23443.25,23773.708714676362,23112.791285323638,0
2023-03-02 20:00:00,23456.7,23560.0,23372.2,23457.1,52550.701,23495.140000000003,55.54176806803779,23380.590713701808,23438.78,23765.758419375245,23111.801580624753,0
2023-03-03 00:00:00,23457.1,23468.5,21883.2,22306.3,265796.815,23481.659999999996,51.184255392885824,22990.81968995939,23390.969999999998,23991.595306090312,22790.344693909683,-1
2023-03-03 04:00:00,22306.4,22399.0,22234.0,22347.8,58370.469,23269.46,489.1366455297863,22889.40334794474,23334.359999999997,24092.439230410146,22576.28076958985,-1
2023-03-03 08:00:00,22347.8,22474.0,22300.0,22333.9,48913.566,23079.7,588.688754776358,22732.59215522758,23278.34,24155.35879809433,22401.32120190567,-1
2023-03-03 12:00:00,22333.9,22495.2,22120.1,22323.9,111464.429,22879.340000000004,581.5922351614971,22550.789450241078,23233.370000000003,24208.966946759585,22257.77305324042,-1
2023-03-03 16:00:00,22324.0,22437.9,22217.2,22348.3,64926.046,22654.920000000002,456.27504534014776,22437.97638958368,23181.704999999998,24230.914325309346,22132.49567469065,-1
2023-03-03 20:00:00,22348.3,22366.0,22126.0,22342.8,59046.812,22434.420000000002,52.93573462379604,22321.5124937547,23123.285,24224.09118357174,22022.478816428258,-1
2023-03-04 00:00:00,22342.8,22379.2,22312.1,22339.4,24078.215,22430.460000000003,56.8441553738032,22322.208304204196,23077.705,24230.508589378747,21924.901410621256,0
2023-03-04 04:00:00,22339.4,22400.0,22262.2,22346.6,29930.134,22415.660000000003,52.1102485137196,22315.703959816576,23038.555,24236.246510189187,21840.863489810814,0
2023-03-04 08:00:00,22346.6,22367.4,22311.0,22338.1,17632.287,22390.1,29.99066521707087,22319.291586174484,22983.879999999997,24205.619420231527,21762.140579768467,0
2023-03-04 12:00:00,22338.0,22390.0,22292.9,22306.3,22528.758,22380.52,14.612049827546466,22314.396422674286,22913.715000000004,24121.065892657276,21706.36410734273,0
2023-03-04 16:00:00,22306.2,22335.5,22204.0,22238.7,29511.608,22374.420000000002,24.919711077035036,22318.52247303748,22838.809999999998,24016.67765390071,21660.942346099284,0
2023-03-04 20:00:00,22238.7,22358.5,22147.5,22335.7,51628.209,22370.28,25.636243877819513,22301.57746936389,22770.454999999998,23894.658655412317,21646.25134458768,0
2023-03-05 00:00:00,22335.8,22650.0,22174.9,22374.2,113479.717,22420.28,129.89309835461378,22344.58215368356,22722.019999999997,23825.66149327783,21618.378506722165,0
2023-03-05 04:00:00,22374.2,22461.8,22354.2,22365.2,30140.514,22439.16,127.11629714619927,22350.98279386732,22659.29,23688.160317438294,21630.419682561707,0
2023-03-05 08:00:00,22365.2,22439.6,22302.0,22380.1,31592.0,22449.079999999998,124.22325466739544,22355.67448382856,22603.94,23561.96783477874,21645.912165221256,0
2023-03-05 12:00:00,22380.1,22480.0,22380.1,22424.4,32097.491,22477.98,106.77692634722109,22375.633058431395,22556.065,23443.498302519896,21668.6316974801,0
2023-03-05 16:00:00,22424.5,22450.6,22357.0,22394.0,21185.383,22496.4,87.15354267130745,22399.42188053114,22505.485,23299.434950099803,21711.535049900198,0
2023-03-05 20:00:00,22394.0,22555.0,22310.0,22419.4,53766.64,22477.4,45.877445440650064,22408.381113015737,22458.94,23146.355141251173,21771.524858748824,0
2023-03-06 00:00:00,22419.3,22499.4,22240.1,22378.0,65552.847,22484.92,45.76256111888481,22399.024255687422,22405.01,22907.135985030076,21902.88401496992,0
2023-03-06 04:00:00,22378.0,22429.6,22306.0,22380.9,27604.231,22482.920000000002,48.38193878049658,22399.285697599607,22351.2,22435.051372272006,22267.348627727995,0
2023-03-06 08:00:00,22380.9,22443.9,22345.3,22370.0,29029.706,22475.7,51.51854035354544,22392.685907951785,22354.385000000002,22435.860918949962,22272.909081050042,0
2023-03-06 12:00:00,22369.9,22594.5,22348.0,22543.6,69925.596,22504.48,70.63750420392206,22421.211166180805,22364.175,22481.49069419981,22246.85930580019,0
2023-03-06 16:00:00,22543.6,22576.1,22350.0,22382.8,72720.927,22508.7,74.91118074198882,22423.949085823864,22366.620000000003,22483.315620268262,22249.924379731743,0
2023-03-06 20:00:00,22382.9,22437.5,22307.9,22397.1,34143.09,22496.32,81.64460790621357,22432.09106221656,22370.28,22485.920998012698,22254.6390019873,0
2023-03-07 00:00:00,22397.1,22550.0,22364.2,22449.1,38691.872,22520.4,74.48845548243307,22442.391740648633,22375.32,22495.620003938857,22255.019996061143,0
2023-03-07 04:00:00,22449.1,22467.8,22402.5,22408.4,18027.854,22525.18,68.91006457810273,22448.10509826944,22378.6,22498.74377352202,22258.456226477978,0
2023-03-07 08:00:00,22408.5,22419.7,22303.3,22339.8,42943.905,22490.22,69.28951580260637,22412.59129611657,22378.62,22498.73642773096,22258.503572269037,0
2023-03-07 12:00:00,22339.8,22482.6,21908.0,22307.5,241400.376,22471.519999999997,50.34478126042923,22292.257896756484,22376.665,22500.1998878926,22253.130112107403,-1
2023-03-07 16:00:00,22307.6,22387.6,22039.0,22118.6,111947.459,22461.54,62.300866768938306,22258.269390304114,22365.690000000002,22534.394286908704,22196.9857130913,0
2023-03-07 20:00:00,22118.5,22223.4,21929.0,22187.1,95482.633,22396.219999999998,103.77568115972089,22216.2045676193,22359.73,22544.88835726069,22174.57164273931,-1
2023-03-08 00:00:00,22187.1,22276.4,22073.3,22141.8,51149.471,22357.94,106.04705559404263,22204.296582871746,22354.885000000002,22557.615272193078,22152.154727806927,-1
2023-03-08 04:00:00,22141.8,22155.5,21800.0,21962.2,89535.711,22305.1,130.56726235993705,22158.176681154593,22336.21,22604.570032321666,22067.849967678332,-1
2023-03-08 08:00:00,21962.2,22135.0,21932.8,22061.2,56848.317,22235.58,101.80109036828915,22097.584671856323,22320.56,22614.845957603186,22026.274042396817,0
2023-03-08 12:00:00,22061.1,22100.0,21990.0,21999.0,18921.38,22178.06,71.03335836194216,22063.265839385676,22302.25,22628.65725288688,21975.84274711312,0
4 changes: 3 additions & 1 deletion Downloader.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import pandas as pd
from stockstats import wrap
class Downloader:
def __init__(self, binance, symbol, timeframe, since, tech_indicator):
def __init__(self, binance, symbol, timeframe, since, until, tech_indicator):
self.binance = binance
self.symbol = symbol
self.timeframe = timeframe
self.since = binance.parse8601(since)
self.until = binance.parse8601(until)
self.tech_indicator = tech_indicator

def download(self):
@@ -17,6 +18,7 @@ def download(self):
if len(x) < 500:
break
df = pd.DataFrame(y, columns=['datetime', 'open', 'high', 'low', 'close', 'volume'])
df = df[df.datetime <= self.until]
df['datetime'] = pd.to_datetime(df['datetime'], unit='ms')
df.set_index('datetime', inplace=True)
tmp = wrap(df)
Binary file modified __pycache__/Downloader.cpython-38.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
"data":{
"symbol": "BTC/USDT",
"since": "2022-11-24T00:00:00Z",
"until": "2023-02-24T00:00:00Z",
"timeframe": "4h",
"tech_indicator": ["high_5_sma", "high_5_mstd", "vwma_5", "boll", "boll_ub", "boll_lb"]
},

0 comments on commit 1c1c765

Please sign in to comment.