ID0M commited on
Commit
8081efa
1 Parent(s): 1026c97

Upload 8 files

Browse files
CSV/BTC-USD-15-23.csv ADDED
The diff for this file is too large to render. See raw diff
 
CSV/BTC-USD.csv ADDED
The diff for this file is too large to render. See raw diff
 
CSV/BTC_All_graph_coinmarketcap.csv ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name;open;high;low;close;volume;marketCap;timestamp
2
+ "2781";135.3000030518;147.4880065918;132.1000061035;139;0;1542813125;"2013-04-01T00:00:00.000Z"
3
+ "2781";139;139.8899993896;79.0999984741;129;0;1447870200;"2013-05-01T00:00:00.000Z"
4
+ "2781";128.8150024414;129.7799987793;88.5;96.6139984131;0;1096957771.35;"2013-06-01T00:00:00.000Z"
5
+ "2781";97.5100021362;111.34400177;65.5260009766;106.0899963379;0;1218777833.5;"2013-07-01T00:00:00.000Z"
6
+ "2781";106.2129974365;140.8899993896;101.2109985352;135.3500061035;0;1574672051.25;"2013-08-01T00:00:00.000Z"
7
+ "2781";135.1399993896;146.5;118.4599990845;133;0;1566038425;"2013-09-01T00:00:00.000Z"
8
+ "2781";132.6799926758;217.4199981689;102.25;204;0;2433658800;"2013-10-01T00:00:00.000Z"
9
+ "2781";203.8999938965;1156.1400146484;201.6499938965;1129.4300537109;0;13620389320.8;"2013-11-01T00:00:00.000Z"
10
+ "2781";1128.9200439453;1156.1199951172;420.5100097656;754.0100097656;20897300;9191325349.25;"2013-12-01T00:00:00.000Z"
11
+ "2781";754.9699707031;1017.1199951172;754.9699707031;829.9199829102;17107900;10238411820;"2014-01-01T00:00:00.000Z"
12
+ "2781";828.6099853516;853.5200195313;420.4100036621;549.2600097656;28076100;6843353923.5;"2014-02-01T00:00:00.000Z"
13
+ "2781";549.9199829102;702.9099731445;443.3649902344;457.0010070801;28254000;5752294437.05;"2014-03-01T00:00:00.000Z"
14
+ "2781";457;542.3779907227;351.2720031738;447.6449890137;15244900;5690810164.88;"2014-04-01T00:00:00.000Z"
15
+ "2781";447.6329956055;624.7150268555;423.2510070801;623.6770019531;15107100;8007248675.68;"2014-05-01T00:00:00.000Z"
16
+ "2781";623.6929931641;674.1110229492;549.8209838867;639.7969970703;46422400;8296103744.68;"2014-06-01T00:00:00.000Z"
17
+ "2781";641.3909912109;657.8579711914;564.5109863281;586.2349853516;22467900;7670841007.38;"2014-07-01T00:00:00.000Z"
18
+ "2781";586.2020263672;598.116027832;443.8510131836;477.7630004883;44632300;6312801959.75;"2014-08-01T00:00:00.000Z"
19
+ "2781";477.7869873047;493.9280090332;372.2399902344;386.9440002441;34707300;5158621324.8;"2014-09-01T00:00:00.000Z"
20
+ "2781";387.4270019531;411.6979980469;289.2959899902;338.3210144043;12545400;4549893052.45;"2014-10-01T00:00:00.000Z"
21
+ "2781";338.6499938965;457.0929870605;320.6260070801;378.0469970703;9194440;5125958175.35;"2014-11-01T00:00:00.000Z"
22
+ "2781";378.2489929199;384.0379943848;304.2319946289;320.1929931641;13942900;4377510594.68;"2014-12-01T00:00:00.000Z"
23
+ "2781";320.4349975586;320.4349975586;171.5099945068;217.4640045166;23348200;2997692310.6;"2015-01-01T00:00:00.000Z"
24
+ "2781";216.8670043945;265.6109924316;212.0149993896;254.2630004883;13949300;3531776635.75;"2015-02-01T00:00:00.000Z"
25
+ "2781";254.2830047607;300.0440063477;236.5149993896;244.2239990234;22672000;3420112896;"2015-03-01T00:00:00.000Z"
26
+ "2781";244.2230072021;261.7980041504;214.8739929199;236.1450042725;33818600;3332094504.38;"2015-04-01T00:00:00.000Z"
27
+ "2781";235.9389953613;247.8040008545;228.5729980469;230.1900024414;14730800;3273756425.25;"2015-05-01T00:00:00.000Z"
28
+ "2781";230.233001709;267.8670043945;221.296005249;263.0719909668;44533800;3770229521.6;"2015-06-01T00:00:00.000Z"
29
+ "2781";263.3450012207;314.3940124512;253.5050048828;284.6499938965;23629100;4112089481.25;"2015-07-01T00:00:00.000Z"
30
+ "2781";284.6860046387;285.7149963379;199.5670013428;230.0559997559;20710700;3349845416;"2015-08-01T00:00:00.000Z"
31
+ "2781";230.2559967041;259.1820068359;225.1170043945;236.0599975586;19743500;3463625759;"2015-09-01T00:00:00.000Z"
32
+ "2781";236.0039978027;334.1690063477;235.6159973145;314.1659851074;48598100;4645486246.35;"2015-10-01T00:00:00.000Z"
33
+ "2781";315.0050048828;495.5620117188;300.9970092773;377.3210144043;71701600;5623195996.95;"2015-11-01T00:00:00.000Z"
34
+ "2781";377.4140014648;469.1029968262;349.4649963379;430.566986084;45996600;6471217490.68;"2015-12-01T00:00:00.000Z"
35
+ "2781";430.7210083008;462.9339904785;354.9140014648;368.766998291;37894300;5587253351.23;"2016-01-01T00:00:00.000Z"
36
+ "2781";369.3500061035;448.0459899902;367.9570007324;437.6969909668;60694700;6681444705;"2016-02-01T00:00:00.000Z"
37
+ "2781";437.9169921875;439.6530151367;394.0350036621;416.7290039063;60215200;6409062819.05;"2016-03-01T00:00:00.000Z"
38
+ "2781";416.7600097656;467.9649963379;415.8309936523;448.3179931641;69322600;6944860514.15;"2016-04-01T00:00:00.000Z"
39
+ "2781";448.4840087891;553.9600219727;437.3890075684;531.3859863281;138450000;8293035755.05;"2016-05-01T00:00:00.000Z"
40
+ "2781";531.1069946289;777.9899902344;525.6359863281;673.3369750977;138980000;10583527799.4;"2016-06-01T00:00:00.000Z"
41
+ "2781";672.5150146484;704.9680175781;611.833984375;624.6810302734;110818000;9861866432.96;"2016-07-01T00:00:00.000Z"
42
+ "2781";624.6019897461;626.1190185547;531.333984375;575.4719848633;75840896;9117106216.7;"2016-08-01T00:00:00.000Z"
43
+ "2781";575.5460205078;628.8179931641;570.8109741211;609.7349853516;56122400;9693198750.06;"2016-09-01T00:00:00.000Z"
44
+ "2781";609.9290161133;720.4019775391;609.4790039063;700.9719848633;97064400;11181852070.1;"2016-10-01T00:00:00.000Z"
45
+ "2781";701.3369750977;756.2369995117;678.1560058594;745.6909790039;84070800;11943536630.3;"2016-11-01T00:00:00.000Z"
46
+ "2781";746.0460205078;979.3969726563;746.0460205078;963.742980957;99135104;15492554222.2;"2016-12-01T00:00:00.000Z"
47
+ "2781";963.6580200195;1191.0999755859;755.7559814453;970.4030151367;164582000;15659186515.2;"2017-01-01T00:00:00.000Z"
48
+ "2781";970.9409790039;1200.3900146484;946.6909790039;1179.9699707031;184956000;19103684800.8;"2017-02-01T00:00:00.000Z"
49
+ "2781";1180.0400390625;1280.3100585938;903.7130126953;1071.7900390625;447287008;17414322807.7;"2017-03-01T00:00:00.000Z"
50
+ "2781";1071.7099609375;1347.9100341797;1061.0899658203;1347.8900146484;413115008;21975104908.9;"2017-04-01T00:00:00.000Z"
51
+ "2781";1348.3000488281;2763.7099609375;1348.3000488281;2286.4099121094;1544829952;37414813240;"2017-05-01T00:00:00.000Z"
52
+ "2781";2288.330078125;2999.9099121094;2212.9599609375;2480.8400878906;860273024;40735082695;"2017-06-01T00:00:00.000Z"
53
+ "2781";2492.6000976563;2916.1398925781;1843.0300292969;2875.3400878906;860574976;47388334773;"2017-07-01T00:00:00.000Z"
54
+ "2781";2871.3000488281;4736.0498046875;2668.5900878906;4703.3901367188;1944930048;77775374624.8;"2017-08-01T00:00:00.000Z"
55
+ "2781";4701.759765625;4975.0400390625;2946.6201171875;4338.7099609375;1207449984;72008428789.3;"2017-09-01T00:00:00.000Z"
56
+ "2781";4341.0498046875;6470.4301757813;4164.0498046875;6468.3999023438;2311379968;107743731291;"2017-10-01T00:00:00.000Z"
57
+ "2781";6440.9702148438;11517.400390625;5519.009765625;10233.599609375;8310689792;171020085600;"2017-11-01T00:00:00.000Z"
58
+ "2781";10198.599609375;20089;9694.650390625;14156.400390625;12136299520;237465823980;"2017-12-01T00:00:00.000Z"
59
+ "2781";14112.2001953125;17712.400390625;9402.2900390625;10221.099609375;8041160192;172099559942;"2018-01-01T00:00:00.000Z"
60
+ "2781";10237.2998046875;11958.5;6048.259765625;10397.900390625;6936189952;175644310997;"2018-02-01T00:00:00.000Z"
61
+ "2781";10385;11704.099609375;6683.9301757813;6973.5297851563;4553269760;118204645927;"2018-03-01T00:00:00.000Z"
62
+ "2781";7003.0600585938;9745.3203125;6526.8701171875;9240.5498046875;8673920000;157163847314;"2018-04-01T00:00:00.000Z"
63
+ "2781";9251.4697265625;9964.5;7090.6801757813;7494.169921875;5127130112;127902999390;"2018-05-01T00:00:00.000Z"
64
+ "2781";7500.7001953125;7754.8901367188;5826.41015625;6404;4543860224;109665618200;"2018-06-01T00:00:00.000Z"
65
+ "2781";6411.6801757813;8424.26953125;6136.419921875;7780.44;5287530000;133688476220;"2018-07-01T00:00:00.000Z"
66
+ "2781";7769.04;7769.04;5971.05;7037.58;4495650000;121346613238;"2018-08-01T00:00:00.000Z"
67
+ "2781";7044.81;7388.43;6197.52;6625.56;4002280000;114608519470;"2018-09-01T00:00:00.000Z"
68
+ "2781";6619.85;6965.06;6236.47;6317.61;4191240000;109627117226;"2018-10-01T00:00:00.000Z"
69
+ "2781";6318.14;6552.16;3585.06;4017.26845712;6048016716.85;69904637061.28;"2018-11-01T00:00:00.000Z"
70
+ "2781";4024.46424203;4309.37731216;3191.30356157;3742.70033544;4661840806.32;65331499157.74;"2018-12-01T00:00:00.000Z"
71
+ "2781";3746.71338747;4109.02106516;3400.81972619;3457.79274724;5831198270.87;60553903927.49;"2019-01-01T00:00:00.000Z"
72
+ "2781";3460.54712403;4210.64175454;3391.02375248;3854.78528208;8399767798.46;67704774107.03;"2019-02-01T00:00:00.000Z"
73
+ "2781";3853.75713203;4296.8066502;3733.74966077;4105.40429618;9045122442.87;72339379035.95;"2019-03-01T00:00:00.000Z"
74
+ "2781";4105.36242087;5642.04459312;4096.90125463;5350.72669668;13878964573.8;94573826827.48;"2019-04-01T00:00:00.000Z"
75
+ "2781";5350.91450555;9008.31456846;5347.6461061;8574.50164907;25365190957.39;152059886413.55;"2019-05-01T00:00:00.000Z"
76
+ "2781";8573.83972489;13796.4890807;7564.48860353;10817.1555981;27256473494.47;192442065810.22;"2019-06-01T00:00:00.000Z"
77
+ "2781";10796.9306183;13129.5289339;9163.13464449;10085.6277491;16631520647.75;180028959602.82;"2019-07-01T00:00:00.000Z"
78
+ "2781";10077.442592;12273.8213783;9421.63015965;9630.66384768;11454806419.01;172470743516.18;"2019-08-01T00:00:00.000Z"
79
+ "2781";9630.59319616;10898.7621803;7830.75876126;8293.86774062;17115474183.47;149011567415.16;"2019-09-01T00:00:00.000Z"
80
+ "2781";8299.72110496;10021.743983;7446.98855091;9199.58483269;26583653946.63;165804227834.59;"2019-10-01T00:00:00.000Z"
81
+ "2781";9193.99198943;9505.05167619;6617.1670508;7569.63012202;17158194786.41;136829391048.65;"2019-11-01T00:00:00.000Z"
82
+ "2781";7571.61619421;7743.43172474;6540.04927709;7193.59897843;21167946112.3;130446112598.42;"2019-12-01T00:00:00.000Z"
83
+ "2781";7194.89197053;9553.12613251;6914.99590793;9350.52936518;29432489719.13;170112778161.32;"2020-01-01T00:00:00.000Z"
84
+ "2781";9346.35762761;10457.6271997;8492.93215312;8599.50861972;35792392544.01;156895988083.74;"2020-02-01T00:00:00.000Z"
85
+ "2781";8599.7583441;9167.69579623;4106.98075029;6438.64476637;32786468812.08;117814077266.54;"2020-03-01T00:00:00.000Z"
86
+ "2781";6437.31921486;9440.65067326;6202.37351173;8658.55417975;66964629541.31;158922133909.09;"2020-04-01T00:00:00.000Z"
87
+ "2781";8672.7819143;9996.74335304;8374.32297508;9461.05891806;27773290298.51;173997151929.68;"2020-05-01T00:00:00.000Z"
88
+ "2781";9463.6056622;10199.5649719;8975.52585473;9137.99340026;15735797743.99;168315606321.29;"2020-06-01T00:00:00.000Z"
89
+ "2781";9145.98505502;11415.8638958;8977.01563525;11323.4664207;23160469766.39;208895308529.07;"2020-07-01T00:00:00.000Z"
90
+ "2781";11382.78588591;13149.69444935;104.61895563;10804.94121976;554052349456.13;199630473235.11;"2020-08-01T00:00:00.000Z"
91
+ "2781";10802.03547482;12059.87014159;9901.90575533;10784.49157795;1174781695423.43;199556965503.78;"2020-09-01T00:00:00.000Z"
92
+ "2781";10795.25474253;14028.21429317;10416.68920469;13780.99470249;1050874546084.33;255372071116.28;"2020-10-01T00:00:00.000Z"
93
+ "2781";13780.99480514;19749.26369425;13243.159866;19625.83502949;1140873393626.59;364229729425.88;"2020-11-01T00:00:00.000Z"
94
+ "2781";19633.77044727;29244.87668786;17619.53238938;29001.71982218;1212259707945.2;539051138107.79;"2020-12-01T00:00:00.000Z"
95
+ "2781";28994.00891641;41946.73935079;28722.75527058;33114.35774753;2153473433573.37;616452744533.29;"2021-01-01T00:00:00.000Z"
96
+ "2781";33114.57724298;58330.57214185;32384.22810648;45137.77046805;2267152936673.9;841428977514.57;"2021-02-01T00:00:00.000Z"
97
+ "2781";45159.50305253;61683.86401412;45115.09311478;58918.83271375;1681184264685.64;1100016786762.56;"2021-03-01T00:00:00.000Z"
98
+ "2781";58926.56414734;64863.0989077;47159.48584083;57750.17734563;1844481772415.39;1079669884319.7;"2021-04-01T00:00:00.000Z"
99
+ "2781";57714.66485835;59519.35442559;30681.49691178;37332.85368874;1976593438571.94;698990486184.97;"2021-05-01T00:00:00.000Z"
100
+ "2781";37293.79237447;41295.26857449;28893.62165844;35040.83724889;1189647451706.77;656852513237.54;"2021-06-01T00:00:00.000Z"
101
+ "2781";35035.98271227;42235.54770874;29360.95583827;41626.19567624;877979009506.43;781431379811.19;"2021-07-01T00:00:00.000Z"
102
+ "2781";41460.84408133;50482.07640834;37458.00399335;47166.68794545;1065642012587.53;886869903602.64;"2021-08-01T00:00:00.000Z"
103
+ "2781";47099.77486941;52853.7637963;39787.6097979604;43790.8956254849;1102139678824.68;824619217607.52;"2021-09-01T00:00:00.000Z"
104
+ "2781";43816.7406442989;66930.3872709899;43320.0229785376;61318.957766606;1153077903531.53;1156485845063.1;"2021-10-01T00:00:00.000Z"
105
+ "2781";61320.4494915952;68789.6259389221;53569.7639630968;57005.4254735998;1053270271384.16;1076689232562.09;"2021-11-01T00:00:00.000Z"
106
+ "2781";56907.9667338266;59041.6852434855;42874.6168583905;46306.4461226996;957047184721.19;875939356678.79;"2021-12-01T00:00:00.000Z"
107
+ "2781";46311.744663041;47881.4062331606;33184.0595656615;38483.126309273;923979037677.66;729073641687.68;"2022-01-01T00:00:00.000Z"
108
+ "2781";38481.7653685119;45661.1731433747;34459.2177282867;43193.2340330233;671335993322.1;819414782676.49;"2022-02-01T00:00:00.000Z"
109
+ "2781";43194.5042113042;48086.8367491568;37260.2017138385;45538.6769223388;830943838434.68;865202119215.74;"2022-03-01T00:00:00.000Z"
110
+ "2781";45554.1638120546;47313.4768544721;37697.9427790922;37714.875545299;830115888651.02;717596901508.72;"2022-04-01T00:00:00.000Z"
111
+ "2781";37713.265089741;39902.9502136511;26350.4901742248;31792.3099432754;1089422059065.44;605797887876.49;"2022-05-01T00:00:00.000Z"
112
+ "2781";31792.5538087129;31957.2843170438;17708.6237125896;19784.7264946249;923939211678.26;377526215552.49;"2022-06-01T00:00:00.000Z"
113
+ "2781";19820.4704741998;24572.5794217469;18966.9506341661;23336.8956049843;927582363389.69;445941074223.04;"2022-07-01T00:00:00.000Z"
114
+ "2781";23336.7180518604;25135.5903960686;19600.7850348256;20049.7631893726;894192654541.42;383710102294.98;"2022-08-01T00:00:00.000Z"
115
+ "2781";20050.4986698419;22673.8197662856;18290.315188225;19431.7894465994;1123272250383.71;372414733487.45;"2022-09-01T00:00:00.000Z"
116
+ "2781";19431.1049459172;20988.3944704236;18319.8226296141;20495.7742320325;957903424925.88;393413045572.67;"2022-10-01T00:00:00.000Z"
117
+ "2781";20494.8976229392;21446.8860966908;15599.0471753829;17168.5655484864;1224531549126.67;329997633644.39;"2022-11-01T00:00:00.000Z"
118
+ "2781";17168.0021376253;18318.530584361;16398.1362516753;16547.4953660162;567256839394.97;318516317872.25;"2022-12-01T00:00:00.000Z"
119
+ "2781";16547.9143978715;23919.8897614092;16521.233430529;23139.2839099123;690928920787.36;446082285297.19;"2023-01-01T00:00:00.000Z"
120
+ "2781";23137.8351361505;25134.1173501961;21460.0885038644;23147.3533899085;723968574896.01;446846764116.35;"2023-02-01T00:00:00.000Z"
121
+ "2781";23150.9299581785;29159.9026178662;19628.2543094205;28478.4846056804;883299703607.68;550593053896.62;"2023-03-01T00:00:00.000Z"
122
+ "2781";28473.3318011971;31005.6080444729;27070.8494995525;29268.8070431626;531060399718.28;566661285145.37;"2023-04-01T00:00:00.000Z"
123
+ "2781";29227.1039819099;29820.1266220765;25878.428829536;27219.6586081109;443473015482.63;527773175252.01;"2023-05-01T00:00:00.000Z"
124
+ "2781";27218.4123755644;31389.5381281357;24797.1678486154;30477.2512822446;481734214225.81;591758288455.82;"2023-06-01T00:00:00.000Z"
125
+ "2781";30471.8475630488;31814.5148120678;28934.2941602457;29230.110878649;382224489087.03;568365621732.67;"2023-07-01T00:00:00.000Z"
126
+ "2781";29230.8724049903;30176.7962374838;25409.1116027686;25931.4728933574;437724169499.52;504957555550.64;"2023-08-01T00:00:00.000Z"
127
+ "2781";25934.0208061586;27488.7638021952;24930.2974941684;26967.9163010637;337637313742.31;525885640459.76;"2023-09-01T00:00:00.000Z"
128
+ "2781";26967.3974331494;35150.4334987547;26558.320783999;34667.7793605467;476425634860.31;677047621125.28;"2023-10-01T00:00:00.000Z"
129
+ "2781";34657.275324496;38415.3381982376;34133.4396153842;37712.7477716325;570863267378.05;737560917365.82;"2023-11-01T00:00:00.000Z"
130
+ "2781";37718.0096264496;44705.5150094178;37629.3589120492;42265.185654866;721704910476.24;827811209384.42;"2023-12-01T00:00:00.000Z"
131
+ "2781";42280.2352761923;48969.3713995297;38521.8938882205;42582.6063895367;825918941348.23;835231465697.41;"2024-01-01T00:00:00.000Z"
132
+ "2781";42569.7613984399;63913.1318135774;41879.1899911815;61198.382897303;830721862618.56;1202008882583.53;"2024-02-01T00:00:00.000Z"
133
+ "2781";61168.0624293716;73750.07385038;59323.9089421326;71333.6479258644;1446417844950.47;1403108244335.61;"2024-03-01T00:00:00.000Z"
134
+ "2781";71333.4847168797;72715.3596085505;59120.0680465683;60636.8567800147;1016068331704.26;1193544962108.24;"2024-04-01T00:00:00.000Z"
135
+ "2781";60609.4979456889;71946.462688481;56555.2940546252;67491.4170108375;874291509756.41;1329961627933.33;"2024-05-01T00:00:00.000Z"
136
+ "2781";67475.4311813476;71321.7756489842;67318.4478280843;70959.4767546807;0;0;"2024-06-01T00:00:00Z"
CSV/combined_btc2_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
CSV/combined_btc_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
part1-scraping-analysis-LT.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
part2-model-training-hyperparameters-LT.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
part3-objected-oriented-programming-input-LT.ipynb ADDED
@@ -0,0 +1 @@
 
 
1
+ {"cells":[{"cell_type":"markdown","metadata":{"id":"IBA0Y-jXHI9w"},"source":["# OBJEKTINIS PROGRAMAVIMAS"]},{"cell_type":"markdown","metadata":{"id":"kRgdtcSRHI9y"},"source":["### Duomenų atsisiuntimas (Coingecko API):"]},{"cell_type":"markdown","metadata":{"id":"HtRe1RqqHI9z"},"source":["ohlc (Open/High/Low/Close):"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"hiVG9XkQHI9z","outputId":"ee2ca931-c487-4761-8e0b-5cb29fee44a7"},"outputs":[{"name":"stdout","output_type":"stream","text":["OHLC Data for the Last 2 Days:\n","1717444800000\n","Time: 2024-06-03 20:00:00, Open: 69763.0, High: 69763.0, Low: 68875.0, Close: 69069.0\n","1717459200000\n","Time: 2024-06-04 00:00:00, Open: 69098.0, High: 69470.0, Low: 68732.0, Close: 68808.0\n","1717473600000\n","Time: 2024-06-04 04:00:00, Open: 68810.0, High: 69343.0, Low: 68744.0, Close: 69150.0\n","1717488000000\n","Time: 2024-06-04 08:00:00, Open: 69149.0, High: 69237.0, Low: 68732.0, Close: 69058.0\n","1717502400000\n","Time: 2024-06-04 12:00:00, Open: 68972.0, High: 69074.0, Low: 68544.0, Close: 68920.0\n","1717516800000\n","Time: 2024-06-04 16:00:00, Open: 68961.0, High: 70569.0, Low: 68844.0, Close: 70569.0\n","1717531200000\n","Time: 2024-06-04 20:00:00, Open: 70413.0, High: 71018.0, Low: 70062.0, Close: 70263.0\n","1717545600000\n","Time: 2024-06-05 00:00:00, Open: 70425.0, High: 70711.0, Low: 70201.0, Close: 70600.0\n","1717560000000\n","Time: 2024-06-05 04:00:00, Open: 70542.0, High: 71235.0, Low: 70444.0, Close: 70868.0\n","1717574400000\n","Time: 2024-06-05 08:00:00, Open: 70995.0, High: 71313.0, Low: 70869.0, Close: 71215.0\n","1717588800000\n","Time: 2024-06-05 12:00:00, Open: 71185.0, High: 71185.0, Low: 70710.0, Close: 70928.0\n","1717603200000\n","Time: 2024-06-05 16:00:00, Open: 70967.0, High: 71625.0, Low: 70409.0, Close: 71484.0\n","1717617600000\n","Time: 2024-06-05 20:00:00, Open: 71587.0, High: 71741.0, Low: 70888.0, Close: 71390.0\n","1717632000000\n","Time: 2024-06-06 00:00:00, Open: 71307.0, High: 71329.0, Low: 70895.0, Close: 71185.0\n","1717646400000\n","Time: 2024-06-06 04:00:00, Open: 71054.0, High: 71241.0, Low: 70939.0, Close: 71043.0\n","1717660800000\n","Time: 2024-06-06 08:00:00, Open: 71054.0, High: 71101.0, Low: 70787.0, Close: 71043.0\n","1717675200000\n","Time: 2024-06-06 12:00:00, Open: 71009.0, High: 71124.0, Low: 70891.0, Close: 71052.0\n","1717689600000\n","Time: 2024-06-06 16:00:00, Open: 71086.0, High: 71595.0, Low: 71005.0, Close: 71277.0\n","1717704000000\n","Time: 2024-06-06 20:00:00, Open: 71238.0, High: 71313.0, Low: 70475.0, Close: 70475.0\n","1717718400000\n","Time: 2024-06-07 00:00:00, Open: 70430.0, High: 70898.0, Low: 70066.0, Close: 70760.0\n","1717732800000\n","Time: 2024-06-07 04:00:00, Open: 70774.0, High: 70991.0, Low: 70661.0, Close: 70960.0\n","1717747200000\n","Time: 2024-06-07 08:00:00, Open: 70985.0, High: 71396.0, Low: 70985.0, Close: 71046.0\n","1717761600000\n","Time: 2024-06-07 12:00:00, Open: 71096.0, High: 71612.0, Low: 71025.0, Close: 71612.0\n","1717776000000\n","Time: 2024-06-07 16:00:00, Open: 71644.0, High: 71931.0, Low: 70743.0, Close: 71056.0\n","1717790400000\n","Time: 2024-06-07 20:00:00, Open: 71068.0, High: 71147.0, Low: 68856.0, Close: 69272.0\n","1717804800000\n","Time: 2024-06-08 00:00:00, Open: 69188.0, High: 69461.0, Low: 68972.0, Close: 69325.0\n","1717819200000\n","Time: 2024-06-08 04:00:00, Open: 69339.0, High: 69490.0, Low: 69260.0, Close: 69437.0\n","1717833600000\n","Time: 2024-06-08 08:00:00, Open: 69393.0, High: 69544.0, Low: 69223.0, Close: 69511.0\n","1717848000000\n","Time: 2024-06-08 12:00:00, Open: 69503.0, High: 69503.0, Low: 69309.0, Close: 69309.0\n","1717862400000\n","Time: 2024-06-08 16:00:00, Open: 69387.0, High: 69487.0, Low: 69206.0, Close: 69436.0\n","1717876800000\n","Time: 2024-06-08 20:00:00, Open: 69406.0, High: 69490.0, Low: 69305.0, Close: 69466.0\n","1717891200000\n","Time: 2024-06-09 00:00:00, Open: 69459.0, High: 69459.0, Low: 69284.0, Close: 69315.0\n","1717905600000\n","Time: 2024-06-09 04:00:00, Open: 69305.0, High: 69338.0, Low: 69158.0, Close: 69264.0\n","1717920000000\n","Time: 2024-06-09 08:00:00, Open: 69255.0, High: 69402.0, Low: 69224.0, Close: 69287.0\n","1717934400000\n","Time: 2024-06-09 12:00:00, Open: 69288.0, High: 69386.0, Low: 69271.0, Close: 69370.0\n","1717948800000\n","Time: 2024-06-09 16:00:00, Open: 69360.0, High: 69743.0, Low: 69214.0, Close: 69533.0\n","1717963200000\n","Time: 2024-06-09 20:00:00, Open: 69539.0, High: 69829.0, Low: 69513.0, Close: 69715.0\n","1717977600000\n","Time: 2024-06-10 00:00:00, Open: 69714.0, High: 69795.0, Low: 69561.0, Close: 69654.0\n","1717992000000\n","Time: 2024-06-10 04:00:00, Open: 69649.0, High: 69771.0, Low: 69446.0, Close: 69599.0\n","1718006400000\n","Time: 2024-06-10 08:00:00, Open: 69594.0, High: 69668.0, Low: 69303.0, Close: 69331.0\n","1718020800000\n","Time: 2024-06-10 12:00:00, Open: 69265.0, High: 69540.0, Low: 69265.0, Close: 69438.0\n","1718035200000\n","Time: 2024-06-10 16:00:00, Open: 69461.0, High: 70120.0, Low: 69240.0, Close: 70120.0\n"]}],"source":["import requests\n","from datetime import datetime\n","from dateutil import parser\n","\n","base_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/ohlc\"\n","\n","params = {\n"," 'vs_currency': 'usd',\n"," 'days': '7',\n","}\n","\n","headers = {\n"," \"accept\": \"application/json\",\n"," \"x-cg-demo-api-key\": \"\"\n","}\n","\n","response = requests.get(base_url, params=params, headers=headers)\n","data = response.json()\n","\n","def format_timestamp(timestamp):\n"," return datetime.utcfromtimestamp(timestamp/1000).strftime('%Y-%m-%d %H:%M:%S')\n","\n","print(\"OHLC Data for the Last 2 Days:\")\n","#print(data)\n","for entry in data:\n"," print(entry[0])\n"," time = format_timestamp(entry[0])\n"," open_price = entry[1]\n"," high_price = entry[2]\n"," low_price = entry[3]\n"," close_price = entry[4]\n"," print(f\"Time: {time}, Open: {open_price}, High: {high_price}, Low: {low_price}, Close: {close_price}\")"]},{"cell_type":"markdown","metadata":{"id":"rmcsemXBHI91"},"source":["### Norint gauti VOLUME turime naudoti kitą nuorodą:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ci5jNO9hHI91","outputId":"84b1f5c5-6a33-4bf5-9bee-a54e5e4bb54c"},"outputs":[{"name":"stdout","output_type":"stream","text":["OHLC and Volume Data for the Last 7 Days:\n","Time: 2024-06-03 19:01:23, Price: 69222.414378, Volume: 30018278644.1606\n","Time: 2024-06-03 20:08:11, Price: 69290.18723123687, Volume: 29701192747.200317\n","Time: 2024-06-03 21:08:14, Price: 69123.47887328567, Volume: 29906664983.140537\n","Time: 2024-06-03 22:02:18, Price: 69013.04238036116, Volume: 30254954583.87357\n","Time: 2024-06-03 23:09:30, Price: 69005.28049701726, Volume: 30358753702.080475\n","Time: 2024-06-04 00:05:16, Price: 68809.78520249174, Volume: 25735381259.850346\n","Time: 2024-06-04 01:03:23, Price: 68993.03011420573, Volume: 30721958753.510273\n","Time: 2024-06-04 02:05:52, Price: 69187.85395378836, Volume: 29280880072.333164\n","Time: 2024-06-04 03:03:48, Price: 69097.86394215949, Volume: 28752894554.199627\n","Time: 2024-06-04 04:08:23, Price: 69068.12651217902, Volume: 29116866216.644135\n","Time: 2024-06-04 05:01:56, Price: 69041.25822711401, Volume: 28803440800.623695\n","Time: 2024-06-04 06:07:09, Price: 68864.94517712682, Volume: 28508162909.899426\n","Time: 2024-06-04 07:03:01, Price: 68913.88379627353, Volume: 26569740587.43989\n","Time: 2024-06-04 08:03:50, Price: 68972.13885024353, Volume: 27211254939.588264\n","Time: 2024-06-04 09:01:39, Price: 68804.00490025479, Volume: 26858437576.66786\n","Time: 2024-06-04 10:00:57, Price: 68544.20771408538, Volume: 27156789279.20647\n","Time: 2024-06-04 11:12:09, Price: 68943.40312278771, Volume: 26892740537.474834\n","Time: 2024-06-04 13:27:17, Price: 69272.28353960442, Volume: 25466083582.290916\n","Time: 2024-06-04 14:10:53, Price: 69839.98961512558, Volume: 23126914513.654984\n","Time: 2024-06-04 15:03:37, Price: 69644.11487424099, Volume: 25837218823.809067\n","Time: 2024-06-04 16:04:17, Price: 70413.21458461684, Volume: 26939408318.65423\n","Time: 2024-06-04 17:02:56, Price: 70770.46287594845, Volume: 27930208932.84292\n","Time: 2024-06-04 18:02:34, Price: 70582.78701003439, Volume: 29147665744.745632\n","Time: 2024-06-04 19:06:00, Price: 70725.13618285558, Volume: 30453315419.68153\n","Time: 2024-06-04 20:04:31, Price: 70425.01676590033, Volume: 31550806009.34074\n","Time: 2024-06-04 21:04:42, Price: 70432.54255820208, Volume: 31394646932.1266\n","Time: 2024-06-04 22:05:13, Price: 70618.36843943138, Volume: 31281193470.70335\n","Time: 2024-06-04 23:07:31, Price: 70526.14065753206, Volume: 31535031052.06846\n","Time: 2024-06-05 00:05:31, Price: 70542.10192339358, Volume: 31807659919.933342\n","Time: 2024-06-05 01:01:41, Price: 70800.51482374071, Volume: 31942981121.956753\n","Time: 2024-06-05 02:09:22, Price: 70876.573651482, Volume: 33549428909.636566\n","Time: 2024-06-05 03:02:31, Price: 70843.34092018707, Volume: 33802925021.480732\n","Time: 2024-06-05 04:00:50, Price: 70868.22714405037, Volume: 33893401267.12407\n","Time: 2024-06-05 05:01:27, Price: 71183.78135845078, Volume: 35071271770.20103\n","Time: 2024-06-05 06:01:50, Price: 71003.3250016292, Volume: 35888450946.553925\n","Time: 2024-06-05 07:00:26, Price: 71149.68396766191, Volume: 36601094148.26381\n","Time: 2024-06-05 08:04:20, Price: 71185.3088652343, Volume: 37020453255.09313\n","Time: 2024-06-05 09:07:36, Price: 70936.64700630313, Volume: 37305992748.97972\n","Time: 2024-06-05 10:02:53, Price: 70857.96640641778, Volume: 32308443302.82607\n","Time: 2024-06-05 11:00:25, Price: 70883.96030648473, Volume: 37289387522.71707\n","Time: 2024-06-05 12:07:45, Price: 70841.58894438873, Volume: 37428505065.4178\n","Time: 2024-06-05 13:04:29, Price: 70979.39844584733, Volume: 37916518163.04748\n","Time: 2024-06-05 14:08:16, Price: 70643.51067253706, Volume: 36505222742.33775\n","Time: 2024-06-05 15:04:34, Price: 70883.84892621133, Volume: 36144156310.39381\n","Time: 2024-06-05 16:03:20, Price: 71587.3390476925, Volume: 23408854375.070045\n","Time: 2024-06-05 17:01:35, Price: 71331.28620844566, Volume: 27438093045.026577\n","Time: 2024-06-05 18:05:31, Price: 71713.94076998901, Volume: 33501843930.990833\n","Time: 2024-06-05 19:05:36, Price: 71118.28092102184, Volume: 32315936125.059055\n","Time: 2024-06-05 20:08:08, Price: 71197.62590248944, Volume: 28080260257.52787\n","Time: 2024-06-05 21:01:14, Price: 71218.07366859974, Volume: 32268164469.349068\n","Time: 2024-06-05 22:04:41, Price: 71144.3179387504, Volume: 31983425815.78001\n","Time: 2024-06-05 23:04:02, Price: 71162.3800160821, Volume: 27403566370.597824\n","Time: 2024-06-06 00:03:53, Price: 71054.14439841534, Volume: 32449132584.340324\n","Time: 2024-06-06 01:04:53, Price: 70990.2501658845, Volume: 31666023356.144684\n","Time: 2024-06-06 02:07:48, Price: 71111.7771693848, Volume: 30396514135.31691\n","Time: 2024-06-06 03:03:50, Price: 71163.70801347587, Volume: 29754435794.37934\n","Time: 2024-06-06 04:04:16, Price: 71053.80230635182, Volume: 25087474397.087322\n","Time: 2024-06-06 05:07:17, Price: 71066.23543064836, Volume: 24328723156.625145\n","Time: 2024-06-06 06:01:25, Price: 70921.91695573041, Volume: 28166890221.34705\n","Time: 2024-06-06 07:07:46, Price: 70891.01993148876, Volume: 23228512662.126297\n","Time: 2024-06-06 08:08:01, Price: 70989.56581977903, Volume: 26536346312.95889\n","Time: 2024-06-06 09:04:37, Price: 70907.02219682894, Volume: 26073781369.281876\n","Time: 2024-06-06 10:06:18, Price: 70952.67189764655, Volume: 24255688211.885937\n","Time: 2024-06-06 11:00:05, Price: 70958.65300241375, Volume: 25207083528.522167\n","Time: 2024-06-06 12:02:46, Price: 71085.53126834088, Volume: 18284513402.94118\n","Time: 2024-06-06 13:01:11, Price: 71173.32805060249, Volume: 22353983551.987164\n","Time: 2024-06-06 14:02:22, Price: 71207.59435524222, Volume: 20117128630.54215\n","Time: 2024-06-06 15:04:16, Price: 71469.15438887932, Volume: 25169763523.085464\n","Time: 2024-06-06 16:02:27, Price: 71238.06260323075, Volume: 20680045468.15438\n","Time: 2024-06-06 17:07:41, Price: 70768.22344988026, Volume: 24435495547.735798\n","Time: 2024-06-06 18:07:32, Price: 71138.39580214774, Volume: 24514488917.096157\n","Time: 2024-06-06 19:00:55, Price: 71069.18929010618, Volume: 23088599940.250572\n","Time: 2024-06-06 20:02:23, Price: 70429.80683094825, Volume: 23298526166.933655\n","Time: 2024-06-06 21:08:48, Price: 70730.16396597322, Volume: 20573485330.701767\n","Time: 2024-06-06 22:04:48, Price: 70704.28903677444, Volume: 23983004831.8955\n","Time: 2024-06-06 23:01:55, Price: 70897.66575927468, Volume: 24254804207.39153\n","Time: 2024-06-07 00:05:07, Price: 70773.74598776827, Volume: 23542405680.725166\n","Time: 2024-06-07 01:03:09, Price: 70858.3516640106, Volume: 22915051048.664154\n","Time: 2024-06-07 02:00:15, Price: 70863.98433867987, Volume: 22865926781.2095\n","Time: 2024-06-07 03:06:26, Price: 70823.64754475745, Volume: 23285903776.776234\n","Time: 2024-06-07 04:08:06, Price: 71094.45975791331, Volume: 23840341525.191322\n","Time: 2024-06-07 05:05:56, Price: 71218.7556793813, Volume: 18572180777.719524\n","Time: 2024-06-07 06:01:00, Price: 71336.03392792157, Volume: 24502336247.901608\n","Time: 2024-06-07 07:00:25, Price: 71280.68092471165, Volume: 24535340895.689938\n","Time: 2024-06-07 08:02:45, Price: 71095.85098124442, Volume: 24753247002.675888\n","Time: 2024-06-07 09:00:57, Price: 71080.68182932476, Volume: 19962060424.69161\n","Time: 2024-06-07 10:06:27, Price: 71273.51614831026, Volume: 25032490299.454735\n","Time: 2024-06-07 11:03:24, Price: 71327.90048172572, Volume: 25082309492.06385\n","Time: 2024-06-07 12:05:06, Price: 71643.88933000261, Volume: 24910257624.061897\n","Time: 2024-06-07 13:06:42, Price: 71186.33669913492, Volume: 27726107166.293755\n","Time: 2024-06-07 14:08:29, Price: 71355.1403021001, Volume: 29110210418.141735\n","Time: 2024-06-07 15:07:34, Price: 71341.85799237363, Volume: 28533090814.15139\n","Time: 2024-06-07 16:07:14, Price: 70950.07816989005, Volume: 29034459548.19106\n","Time: 2024-06-07 17:03:09, Price: 70768.04687954747, Volume: 24151162065.934326\n","Time: 2024-06-07 18:03:14, Price: 69678.62142097896, Volume: 25281609856.78319\n","Time: 2024-06-07 19:04:24, Price: 69123.85740127321, Volume: 33886460645.07946\n","Time: 2024-06-07 20:07:53, Price: 69096.92925087264, Volume: 30518286007.66723\n","Time: 2024-06-07 21:07:51, Price: 69228.75408533507, Volume: 33795460102.69083\n","Time: 2024-06-07 22:03:53, Price: 69218.12095730139, Volume: 34803202951.225845\n","Time: 2024-06-07 23:01:43, Price: 69461.03394002216, Volume: 29971593945.38651\n","Time: 2024-06-08 00:05:40, Price: 69260.21173528439, Volume: 34530240693.47627\n","Time: 2024-06-08 01:01:55, Price: 69382.28142333424, Volume: 29896818076.678574\n","Time: 2024-06-08 02:04:38, Price: 69425.41471694803, Volume: 33931602012.927334\n","Time: 2024-06-08 03:07:33, Price: 69409.18581526849, Volume: 34156263058.001987\n","Time: 2024-06-08 04:01:40, Price: 69392.79120773365, Volume: 34777753548.18209\n","Time: 2024-06-08 05:02:43, Price: 69308.10284340921, Volume: 29490345701.12805\n","Time: 2024-06-08 06:04:43, Price: 69288.12202319676, Volume: 32336587511.897495\n","Time: 2024-06-08 07:03:23, Price: 69308.1573604734, Volume: 32696236402.042667\n","Time: 2024-06-08 08:05:08, Price: 69503.48114691078, Volume: 22182930704.80761\n","Time: 2024-06-08 09:08:16, Price: 69391.17587185616, Volume: 26985809860.280293\n","Time: 2024-06-08 10:02:58, Price: 69422.0549280154, Volume: 31130109779.05146\n","Time: 2024-06-08 11:05:32, Price: 69432.25588125558, Volume: 31637000794.878254\n","Time: 2024-06-08 12:07:38, Price: 69258.72930891113, Volume: 30444607252.586044\n","Time: 2024-06-08 13:00:08, Price: 69337.60341855812, Volume: 21278674018.799137\n","Time: 2024-06-08 14:05:16, Price: 69410.6900283224, Volume: 22416729426.38913\n","Time: 2024-06-08 15:03:55, Price: 69443.1469916804, Volume: 24793573162.39803\n","Time: 2024-06-08 16:04:09, Price: 69405.63763463982, Volume: 18643901114.6999\n","Time: 2024-06-08 17:07:54, Price: 69361.46134430173, Volume: 23240462940.428947\n","Time: 2024-06-08 18:02:31, Price: 69439.96089497658, Volume: 21706735146.153076\n","Time: 2024-06-08 19:09:28, Price: 69487.75689863384, Volume: 15944945605.432377\n","Time: 2024-06-08 20:07:12, Price: 69449.81437968381, Volume: 14323080270.105919\n","Time: 2024-06-08 21:00:38, Price: 69359.75273517056, Volume: 10920602546.69344\n","Time: 2024-06-08 22:07:06, Price: 69396.27529521167, Volume: 12555336072.788439\n","Time: 2024-06-08 23:06:45, Price: 69311.00170202478, Volume: 12957020044.270039\n","Time: 2024-06-09 00:03:33, Price: 69305.38413230315, Volume: 12847962289.456978\n","Time: 2024-06-09 01:00:27, Price: 69271.82967363774, Volume: 10066718992.903212\n","Time: 2024-06-09 02:06:56, Price: 69294.7352566043, Volume: 12256443708.45615\n","Time: 2024-06-09 03:07:23, Price: 69189.27484588115, Volume: 9810267642.45181\n","Time: 2024-06-09 04:05:57, Price: 69255.12336023682, Volume: 12471446688.148481\n","Time: 2024-06-09 05:08:07, Price: 69268.84907656063, Volume: 11802177182.232487\n","Time: 2024-06-09 06:02:30, Price: 69301.42826402026, Volume: 11543478483.317194\n","Time: 2024-06-09 07:08:09, Price: 69402.31338469898, Volume: 11924620294.002207\n","Time: 2024-06-09 08:04:36, Price: 69288.40380070929, Volume: 11704771165.89392\n","Time: 2024-06-09 09:03:56, Price: 69341.41547524066, Volume: 10767884026.333746\n","Time: 2024-06-09 10:02:08, Price: 69358.75947957805, Volume: 8083520040.423612\n","Time: 2024-06-09 11:07:55, Price: 69355.05403630743, Volume: 11071015486.305046\n","Time: 2024-06-09 12:05:02, Price: 69359.77053101533, Volume: 10035350491.603842\n","Time: 2024-06-09 13:00:40, Price: 69739.25483618052, Volume: 10516657684.233894\n","Time: 2024-06-09 14:04:39, Price: 69464.54727961162, Volume: 11297784378.652313\n","Time: 2024-06-09 15:01:52, Price: 69489.02263323929, Volume: 11553052270.80147\n","Time: 2024-06-09 16:08:47, Price: 69512.58598901884, Volume: 11572887601.519272\n","Time: 2024-06-09 17:05:10, Price: 69636.44792486633, Volume: 11652997673.72068\n","Time: 2024-06-09 18:02:01, Price: 69658.46681164297, Volume: 8892545791.355675\n","Time: 2024-06-09 19:05:09, Price: 69737.12919334027, Volume: 11181055187.672602\n","Time: 2024-06-09 20:06:42, Price: 69649.06870027601, Volume: 12243631285.687578\n","Time: 2024-06-09 21:00:39, Price: 69681.23501022052, Volume: 9639902370.746393\n","Time: 2024-06-09 22:08:33, Price: 69705.3147840307, Volume: 12450794791.207031\n","Time: 2024-06-09 23:01:31, Price: 69616.31203554032, Volume: 12405209299.492361\n","Time: 2024-06-10 00:07:00, Price: 69600.84597186842, Volume: 12177078985.637917\n","Time: 2024-06-10 01:03:19, Price: 69556.82634403778, Volume: 12674997971.943167\n","Time: 2024-06-10 02:04:03, Price: 69601.3025268636, Volume: 12821436653.12271\n","Time: 2024-06-10 03:04:19, Price: 69699.90448151037, Volume: 12391073288.204947\n","Time: 2024-06-10 04:03:02, Price: 69593.50742064392, Volume: 9463972664.40574\n","Time: 2024-06-10 05:01:18, Price: 69668.47016488576, Volume: 12786445630.355762\n","Time: 2024-06-10 06:05:09, Price: 69532.87864605538, Volume: 11321024709.35716\n","Time: 2024-06-10 07:05:51, Price: 69400.28705440945, Volume: 11765945602.861357\n","Time: 2024-06-10 08:07:55, Price: 69371.00641265, Volume: 14182912692.154623\n","Time: 2024-06-10 09:06:06, Price: 69384.4040382232, Volume: 14480867950.88864\n","Time: 2024-06-10 10:02:39, Price: 69425.34660664776, Volume: 12575088777.254637\n","Time: 2024-06-10 11:00:51, Price: 69432.85832587274, Volume: 15209188235.74221\n","Time: 2024-06-10 12:07:43, Price: 69407.0113316572, Volume: 15431534376.450335\n","Time: 2024-06-10 13:05:03, Price: 69284.76519309687, Volume: 13561423862.636637\n","Time: 2024-06-10 14:01:04, Price: 69330.06966003006, Volume: 14748983511.134398\n","Time: 2024-06-10 15:09:19, Price: 69642.34736119978, Volume: 15131749929.976673\n","Time: 2024-06-10 16:07:55, Price: 70026.23809524855, Volume: 16722170218.940643\n","Time: 2024-06-10 17:04:01, Price: 69968.38351995572, Volume: 15317364706.86971\n","Time: 2024-06-10 18:09:58, Price: 69934.87931158906, Volume: 17755231708.302704\n","Time: 2024-06-10 18:26:01, Price: 69849.0972479416, Volume: 18112300454.465282\n"]}],"source":["import requests\n","from datetime import datetime\n","\n","base_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/market_chart\"\n","\n","params = {\n"," 'vs_currency': 'usd',\n"," 'days': '7' # Get data for the last 7 days\n","}\n","\n","headers = {\n"," \"accept\": \"application/json\",\n"," \"x-cg-demo-api-key\": \"CG-HWFe76jzP5YcNf1qKdiSY4VL\"\n","}\n","\n","response = requests.get(base_url, params=params, headers=headers)\n","data = response.json()\n","\n","def format_timestamp(timestamp):\n"," return datetime.utcfromtimestamp(timestamp / 1000).strftime('%Y-%m-%d %H:%M:%S')\n","\n","prices = data['prices']\n","volumes = data['total_volumes']\n","\n","\n","print(\"OHLC and Volume Data for the Last 7 Days:\")\n","for i in range(len(prices)):\n"," time = format_timestamp(prices[i][0])\n"," price = prices[i][1]\n"," volume = volumes[i][1]\n"," print(f\"Time: {time}, Price: {price}, Volume: {volume}\")"]},{"cell_type":"markdown","metadata":{"id":"uyo9L22WHI92"},"source":["### Sujungiame abi užklausas bei išfiltruojame po vieną įrašą iš 2 paskutinių dienų:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"bQQvAxL7HI92","outputId":"192d8493-3622-45ed-9bf1-fcbabe0ad039"},"outputs":[{"name":"stdout","output_type":"stream","text":["{'date': '2024-06-09 00:00:00', 'open': 69459.0, 'high': 69459.0, 'low': 69284.0, 'close': 69315.0, 'volume': 12847962289.456978}\n","{'date': '2024-06-10 00:00:00', 'open': 69714.0, 'high': 69795.0, 'low': 69561.0, 'close': 69654.0, 'volume': 12177078985.637917}\n"]}],"source":["import requests\n","from datetime import datetime, timedelta\n","\n","ohlc_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/ohlc\"\n","market_chart_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/market_chart\"\n","params = {\n"," 'vs_currency': 'usd',\n"," 'days': '7'\n","}\n","headers = {\n"," \"accept\": \"application/json\",\n"," \"x-cg-demo-api-key\": \"CG-HWFe76jzP5YcNf1qKdiSY4VL\"\n","}\n","\n","def is_midnight(timestamp):\n"," dt = datetime.utcfromtimestamp(timestamp / 1000)\n"," return dt.hour == 0 and dt.minute == 0 and dt.second == 0\n","\n","def format_timestamp(timestamp):\n"," return datetime.utcfromtimestamp(timestamp / 1000).strftime('%Y-%m-%d %H:%M:%S')\n","\n","def find_closest_volume(timestamp, volume_data):\n"," closest_volume, closest_diff = None, 10e10\n"," for vol_entry in volume_data:\n"," vol_timestamp = vol_entry[0]\n"," diff = abs(timestamp - vol_timestamp)\n"," if diff < closest_diff:\n"," closest_diff = diff\n"," closest_volume = vol_entry[1]\n"," closest_timestamp = vol_timestamp\n"," return closest_volume\n","\n","response_ohlc = requests.get(ohlc_url, params=params, headers=headers)\n","response_market_chart = requests.get(market_chart_url, params=params, headers=headers)\n","\n","if response_ohlc.ok and response_market_chart.ok:\n"," ohlc_data = response_ohlc.json()\n"," market_data = response_market_chart.json()\n"," results = []\n"," today = datetime.utcnow()\n"," start_date = today - timedelta(days=2)\n"," for entry in ohlc_data:\n"," timestamp = entry[0]\n"," if is_midnight(timestamp) and datetime.utcfromtimestamp(timestamp / 1000) >= start_date:\n"," open_price, high_price, low_price, close_price = entry[1:]\n"," time_formatted = format_timestamp(timestamp)\n"," volume = find_closest_volume(timestamp, market_data['total_volumes'])\n"," results.append({\n"," 'date': time_formatted,\n"," 'open': open_price,\n"," 'high': high_price,\n"," 'low': low_price,\n"," 'close': close_price,\n"," 'volume': volume\n"," })\n"," for result in results:\n"," print(result)\n","else:\n"," if response_ohlc.status_code != 200: print(f'bitcoin/ohlc ERROR: {response_ohlc.text}')\n"," if response_market_chart.status_code != 200: print(f'bitcoin/market_chart ERROR: {response_market_chart.text}')\n"]},{"cell_type":"markdown","metadata":{"id":"vvN_NML_HI93"},"source":["# Aplikacija su integruotu Coingecko API:"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"WkK3eUhJHI93"},"outputs":[],"source":["import pandas as pd\n","from sklearn.preprocessing import StandardScaler\n","from sklearn.linear_model import Lasso\n","from sklearn.ensemble import RandomForestRegressor\n","import sqlite3\n","import warnings\n","import requests\n","from datetime import datetime, timedelta\n","\n","class BTCModel:\n"," def __init__(self, data_path, reviews_path, random_forest=False, use_extended_features=False):\n"," self.btc_all = pd.read_csv(data_path)\n"," self.reviews = pd.read_csv(reviews_path, sep='|')\n"," self.scaler = StandardScaler()\n"," self.random_forest = random_forest\n"," self.use_extended_features = use_extended_features\n","\n"," if random_forest:\n"," self.model = RandomForestRegressor(\n"," max_depth=None, min_samples_leaf=2, min_samples_split=2, n_estimators=300, random_state=73\n"," )\n"," else:\n"," self.model = Lasso(alpha=75, max_iter=25000, tol=0.001, random_state=0)\n","\n"," self._preprocess()\n"," self._train()\n","\n"," def _preprocess(self):\n"," self.reviews['Date'] = pd.to_datetime(self.reviews['Date'], errors='coerce')\n"," self.reviews = self.reviews.dropna(subset=['Date'])\n"," self.reviews['YearMonth'] = self.reviews['Date'].dt.to_period('M')\n"," monthly_mean_rating = self.reviews.groupby('YearMonth')['Rating'].mean().reset_index()\n"," monthly_mean_rating['Date'] = monthly_mean_rating['YearMonth'].dt.to_timestamp()\n"," self.btc_all['Date'] = pd.to_datetime(self.btc_all['Date'])\n"," self.btc_all['YearMonth'] = self.btc_all['Date'].dt.to_period('M')\n"," btc_merged = pd.merge(self.btc_all, monthly_mean_rating, on='YearMonth', how='left')\n"," btc_merged['Date'] = btc_merged['Date_x']\n"," btc_merged = btc_merged.drop(columns=['Date_x', 'Date_y'])\n"," btc_merged['Rating'].fillna(method='ffill', inplace=True)\n"," btc_merged['Lag_Close_1'] = btc_merged['Close'].shift(1)\n"," btc_merged['Lag_Close_2'] = btc_merged['Close'].shift(2)\n"," btc_merged['Lag_Volume_1'] = btc_merged['Volume'].shift(1)\n"," btc_merged['Lag_Volume_2'] = btc_merged['Volume'].shift(2)\n"," btc_merged['Lag_Open_1'] = btc_merged['Open'].shift(1)\n"," btc_merged['Lag_Open_2'] = btc_merged['Open'].shift(2)\n"," btc_merged['Lag_High_1'] = btc_merged['High'].shift(1)\n"," btc_merged['Lag_High_2'] = btc_merged['High'].shift(2)\n"," btc_merged['Lag_Low_1'] = btc_merged['Low'].shift(1)\n"," btc_merged['Lag_Low_2'] = btc_merged['Low'].shift(2)\n"," btc_merged.dropna(inplace=True)\n"," btc_merged['Day'] = btc_merged['Date'].dt.day\n"," btc_merged['Month'] = btc_merged['Date'].dt.month\n"," btc_merged['Year'] = btc_merged['Date'].dt.year\n"," self.btc_all = btc_merged\n","\n"," def _train(self):\n"," if self.use_extended_features:\n"," features = [\n"," 'Lag_Close_1', 'Lag_Close_2', 'Lag_Volume_1', 'Lag_Volume_2',\n"," 'Lag_Open_1', 'Lag_Open_2', 'Lag_High_1', 'Lag_High_2', 'Lag_Low_1', 'Lag_Low_2',\n"," 'Day', 'Month', 'Year', 'Rating'\n"," ]\n"," else:\n"," features = [\n"," 'Lag_Close_1', 'Lag_Close_2', 'Lag_Volume_1', 'Lag_Volume_2',\n"," 'Day', 'Month', 'Year', 'Rating'\n"," ]\n","\n"," X = self.btc_all[features]\n"," y = self.btc_all['Close']\n","\n"," assert len(X) == len(y), \"Feature X and target y arrays length mismatch!\"\n","\n"," X_train = X.copy()\n"," y_train = y.copy()\n","\n"," assert len(X_train) == len(y_train), \"Training feature X_train and target arrays y_train length mismatch!\"\n","\n"," X_train = self.scaler.fit_transform(X_train)\n"," self.model.fit(X_train, y_train)\n","\n"," def _fetch_coingecko_data(self):\n"," ohlc_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/ohlc\"\n"," market_chart_url = \"https://api.coingecko.com/api/v3/coins/bitcoin/market_chart\"\n"," params = {\n"," 'vs_currency': 'usd',\n"," 'days': '7'\n"," }\n"," headers = {\n"," \"accept\": \"application/json\",\n"," \"x-cg-demo-api-key\": \"CG-HWFe76jzP5YcNf1qKdiSY4VL\"\n"," }\n","\n"," response_ohlc = requests.get(ohlc_url, params=params, headers=headers)\n"," response_market_chart = requests.get(market_chart_url, params=params, headers=headers)\n","\n"," if response_ohlc.ok and response_market_chart.ok:\n"," ohlc_data = response_ohlc.json()\n"," market_data = response_market_chart.json()\n"," results = []\n"," today = datetime.utcnow()\n"," start_date = today - timedelta(days=2)\n"," for entry in ohlc_data:\n"," timestamp = entry[0]\n"," if self._is_midnight(timestamp) and datetime.utcfromtimestamp(timestamp / 1000) >= start_date:\n"," open_price, high_price, low_price, close_price = entry[1:]\n"," time_formatted = self._format_timestamp(timestamp)\n"," volume = self._find_closest_volume(timestamp, market_data['total_volumes'])\n"," results.append({\n"," 'date': time_formatted,\n"," 'open': open_price,\n"," 'high': high_price,\n"," 'low': low_price,\n"," 'close': close_price,\n"," 'volume': volume\n"," })\n"," for result in results:\n"," print(result)\n"," return results\n"," else:\n"," if response_ohlc.status_code != 200:\n"," print(f'bitcoin/ohlc ERROR: {response_ohlc.text}')\n"," if response_market_chart.status_code != 200:\n"," print(f'bitcoin/market_chart ERROR: {response_market_chart.text}')\n"," raise ValueError(\"API ERROR.\")\n","\n"," def _get_lag_data_from_api(self):\n"," btc_data = self._fetch_coingecko_data()\n"," date_plus_one = datetime.now() + timedelta(days=1)\n"," data = {\n"," 'Lag_Close_1': btc_data[1]['close'],\n"," 'Lag_Close_2': btc_data[0]['close'],\n"," 'Lag_Volume_1': btc_data[1]['volume'],\n"," 'Lag_Volume_2': btc_data[0]['volume'],\n"," 'Lag_Open_1': btc_data[1]['open'],\n"," 'Lag_Open_2': btc_data[0]['open'],\n"," 'Lag_High_1': btc_data[1]['high'],\n"," 'Lag_High_2': btc_data[0]['high'],\n"," 'Lag_Low_1': btc_data[1]['low'],\n"," 'Lag_Low_2': btc_data[0]['low'],\n"," 'Day': date_plus_one.day,\n"," 'Month': date_plus_one.month,\n"," 'Year': date_plus_one.year,\n"," 'Rating': 1.4\n"," }\n"," return data\n","\n"," def predict(self, user_input=None, date=None, use_api=False):\n"," warnings.filterwarnings(\"ignore\", message=\"X does not have valid feature names, but StandardScaler was fitted with feature names\")\n"," if use_api:\n"," user_input_processed = self._get_lag_data_from_api()\n"," user_input_scaled = self.scaler.transform([list(user_input_processed.values())])\n"," elif user_input is not None and date is None:\n"," user_input_processed = self._preprocess_user_input(user_input)\n"," user_input_scaled = self.scaler.transform([user_input_processed])\n"," elif date is not None:\n"," user_input = self._get_lag_data(date)\n"," user_input_scaled = self.scaler.transform([list(user_input.values())])\n"," else:\n"," raise ValueError(\"ERROR.\")\n","\n"," prediction = self.model.predict(user_input_scaled)\n"," return prediction[0]\n","\n"," def _preprocess_user_input(self, user_input):\n"," if self.use_extended_features:\n"," return [\n"," user_input['Lag_Close_1'],\n"," user_input['Lag_Close_2'],\n"," user_input['Lag_Volume_1'],\n"," user_input['Lag_Volume_2'],\n"," user_input['Lag_Open_1'],\n"," user_input['Lag_Open_2'],\n"," user_input['Lag_High_1'],\n"," user_input['Lag_High_2'],\n"," user_input['Lag_Low_1'],\n"," user_input['Lag_Low_2'],\n"," user_input['Day'],\n"," user_input['Month'],\n"," user_input['Year'],\n"," user_input['Rating']\n"," ]\n"," else:\n"," return [\n"," user_input['Lag_Close_1'],\n"," user_input['Lag_Close_2'],\n"," user_input['Lag_Volume_1'],\n"," user_input['Lag_Volume_2'],\n"," user_input['Day'],\n"," user_input['Month'],\n"," user_input['Year'],\n"," user_input['Rating']\n"," ]\n","\n"," def _get_lag_data(self, date):\n"," date = pd.to_datetime(date)\n"," if date > self.btc_all['Date'].max():\n"," most_recent = self.btc_all.iloc[-1]\n"," if self.use_extended_features:\n"," return {\n"," 'Lag_Close_1': most_recent['Close'],\n"," 'Lag_Close_2': most_recent['Lag_Close_1'],\n"," 'Lag_Volume_1': most_recent['Volume'],\n"," 'Lag_Volume_2': most_recent['Lag_Volume_1'],\n"," 'Lag_Open_1': most_recent['Open'],\n"," 'Lag_Open_2': most_recent['Lag_Open_1'],\n"," 'Lag_High_1': most_recent['High'],\n"," 'Lag_High_2': most_recent['Lag_High_1'],\n"," 'Lag_Low_1': most_recent['Low'],\n"," 'Lag_Low_2': most_recent['Lag_Low_1'],\n"," 'Day': date.day,\n"," 'Month': date.month,\n"," 'Year': date.year,\n"," 'Rating': most_recent['Rating']\n"," }\n"," else:\n"," return {\n"," 'Lag_Close_1': most_recent['Close'],\n"," 'Lag_Close_2': most_recent['Lag_Close_1'],\n"," 'Lag_Volume_1': most_recent['Volume'],\n"," 'Lag_Volume_2': most_recent['Lag_Volume_1'],\n"," 'Day': date.day,\n"," 'Month': date.month,\n"," 'Year': date.year,\n"," 'Rating': most_recent['Rating']\n"," }\n"," row = self.btc_all[self.btc_all['Date'] == date]\n"," if row.empty:\n"," row = self.btc_all[self.btc_all['Date'] < date].iloc[-1]\n"," if self.use_extended_features:\n"," return {\n"," 'Lag_Close_1': row['Lag_Close_1'].values[0],\n"," 'Lag_Close_2': row['Lag_Close_2'].values[0],\n"," 'Lag_Volume_1': row['Lag_Volume_1'].values[0],\n"," 'Lag_Volume_2': row['Lag_Volume_2'].values[0],\n"," 'Lag_Open_1': row['Lag_Open_1'].values[0],\n"," 'Lag_Open_2': row['Lag_Open_2'].values[0],\n"," 'Lag_High_1': row['Lag_High_1'].values[0],\n"," 'Lag_High_2': row['Lag_High_2'].values[0],\n"," 'Lag_Low_1': row['Lag_Low_1'].values[0],\n"," 'Lag_Low_2': row['Lag_Low_2'].values[0],\n"," 'Day': date.day,\n"," 'Month': date.month,\n"," 'Year': date.year,\n"," 'Rating': row['Rating'].values[0]\n"," }\n"," else:\n"," return {\n"," 'Lag_Close_1': row['Lag_Close_1'].values[0],\n"," 'Lag_Close_2': row['Lag_Close_2'].values[0],\n"," 'Lag_Volume_1': row['Lag_Volume_1'].values[0],\n"," 'Lag_Volume_2': row['Lag_Volume_2'].values[0],\n"," 'Day': date.day,\n"," 'Month': date.month,\n"," 'Year': date.year,\n"," 'Rating': row['Rating'].values[0]\n"," }\n","\n"," def _is_midnight(self, timestamp):\n"," dt = datetime.utcfromtimestamp(timestamp / 1000)\n"," return dt.hour == 0 and dt.minute == 0 and dt.second == 0\n","\n"," def _format_timestamp(self, timestamp):\n"," return datetime.utcfromtimestamp(timestamp / 1000).strftime('%Y-%m-%d %H:%M:%S')\n","\n"," def _find_closest_volume(self, timestamp, volume_data):\n"," closest_volume, closest_diff = None, 10e10\n"," for vol_entry in volume_data:\n"," vol_timestamp = vol_entry[0]\n"," diff = abs(timestamp - vol_timestamp)\n"," if diff < closest_diff:\n"," closest_diff = diff\n"," closest_volume = vol_entry[1]\n"," return closest_volume\n","\n","class user_inputDatabase:\n"," def __init__(self, db_path):\n"," self.db_path = db_path\n"," self._initialize_db()\n","\n"," def _initialize_db(self):\n"," conn = sqlite3.connect(self.db_path)\n"," c = conn.cursor()\n"," c.execute('''CREATE TABLE IF NOT EXISTS user_inputs\n"," (Lag_Close_1 REAL, Lag_Close_2 REAL, Lag_Volume_1 REAL, Lag_Volume_2 REAL,\n"," Lag_Open_1 REAL, Lag_Open_2 REAL, Lag_High_1 REAL, Lag_High_2 REAL, Lag_Low_1 REAL, Lag_Low_2 REAL,\n"," Day INTEGER, Month INTEGER, Year INTEGER, Rating REAL)''')\n"," conn.commit()\n"," conn.close()\n","\n"," def save_user_input(self, user_input):\n"," conn = sqlite3.connect(self.db_path)\n"," c = conn.cursor()\n"," columns = ', '.join(user_input.keys())\n"," placeholders = ', '.join('?' * len(user_input))\n"," values = tuple(user_input.values())\n","\n"," query = f\"INSERT INTO user_inputs ({columns}) VALUES ({placeholders})\"\n"," c.execute(query, values)\n","\n"," conn.commit()\n"," conn.close()\n"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"G47qeNmgHI94","outputId":"ddaf22c6-e075-4f4f-dbac-2df9c60fb459"},"outputs":[{"name":"stdout","output_type":"stream","text":["BTC Prediction Model\n","Norėdami įšeiti įveskite 'q'\n","Nuspėjama modelio BTC kaina šiam laikotarpiui (2024-9-1) --> 69,031.21 USD <--\n"]}],"source":["import json\n","from datetime import datetime\n","\n","try_again = 'Neteisinga įvestis, bandykite dar kartą.'\n","\n","def get_float_input(prompt, quit_char='q'):\n"," while True:\n"," inp = input(prompt).strip().lower()\n"," if inp == quit_char:\n"," return quit_char\n"," try:\n"," return float(inp)\n"," except ValueError:\n"," print(try_again)\n","\n","def get_int_input(prompt, quit_char='q'):\n"," while True:\n"," inp = input(prompt).strip().lower()\n"," if inp == quit_char:\n"," return quit_char\n"," try:\n"," return int(inp)\n"," except ValueError:\n"," print(try_again)\n","\n","def get_date_input(prompt, format=\"%Y-%m-%d\", quit_char='q'):\n"," while True:\n"," inp = input(prompt).strip().lower()\n"," if inp == quit_char:\n"," return quit_char\n"," try:\n"," return datetime.strptime(inp, format)\n"," except ValueError:\n"," print(try_again)\n","\n","def main():\n"," db_path = 'inputs_btc2_advanced.db'\n"," user_db = user_inputDatabase(db_path)\n"," print(\"BTC Prediction Model\")\n"," date = None\n"," model = None\n"," data_path = 'combined_btc2_data.csv'\n"," reviews_path = 'trustpilot_coinbase_reviews-strip.csv'\n"," user_input = {}\n","\n"," print(\"Norėdami įšeiti įveskite 'q'\")\n","\n"," use_api = input(\"Ar norite naudoti API? (y/n)\").strip().lower()\n"," if use_api == 'q':\n"," return\n","\n"," if use_api == 'y':\n"," print(\"Parsisiunčiami duomenys...\")\n"," model = BTCModel(data_path, reviews_path, random_forest=False, use_extended_features=True)\n"," #user_input = model._get_lag_data_from_api()\n"," else:\n"," extended_features = input(\"Ar norite naudoti visus įvesties duomenis? (y/n)\\nNenaudojant visos įvesties spėjimams bus naudojama tik data.\").strip().lower()\n"," if extended_features == 'q':\n"," return\n"," if extended_features == 'y':\n"," print(\"Įveskite paskutinių 2 dienų duomenis:\")\n"," user_input['Lag_Close_1'] = get_float_input(\"Lag_Close_1: \")\n"," user_input['Lag_Close_2'] = get_float_input(\"Lag_Close_2: \")\n"," user_input['Lag_Volume_1'] = get_float_input(\"Lag_Volume_1: \")\n"," user_input['Lag_Volume_2'] = get_float_input(\"Lag_Volume_2: \")\n"," user_input['Lag_Open_1'] = get_float_input(\"Lag_Open_1: \")\n"," user_input['Lag_Open_2'] = get_float_input(\"Lag_Open_2: \")\n"," user_input['Lag_High_1'] = get_float_input(\"Lag_High_1: \")\n"," user_input['Lag_High_2'] = get_float_input(\"Lag_High_2: \")\n"," user_input['Lag_Low_1'] = get_float_input(\"Lag_Low_1: \")\n"," user_input['Lag_Low_2'] = get_float_input(\"Lag_Low_2: \")\n"," user_input['Day'] = get_int_input(\"Nuspėjama diena: \")\n"," user_input['Month'] = get_int_input(\"Mėnuo: \")\n"," user_input['Year'] = get_int_input(\"Metai: \")\n"," user_input['Rating'] = get_float_input(\"Vidutinis einamojo mėn. Coinbase reitingas: \")\n"," else:\n"," date = get_date_input(\"Įveskite datą BTC kainos nuspėjimui (YYYY-MM-DD): \")\n"," if date == 'q':\n"," return\n"," user_input['Day'] = date.day\n"," user_input['Month'] = date.month\n"," user_input['Year'] = date.year\n","\n"," if 'Rating' not in user_input or user_input['Rating'] is None:\n"," user_input['Rating'] = 1.4\n","\n"," default_keys = ['Lag_Close_1', 'Lag_Close_2', 'Lag_Volume_1', 'Lag_Volume_2',\n"," 'Lag_Open_1', 'Lag_Open_2', 'Lag_High_1', 'Lag_High_2',\n"," 'Lag_Low_1', 'Lag_Low_2', 'Day', 'Month', 'Year', 'Rating']\n","\n"," for key in default_keys:\n"," user_input.setdefault(key, 0.0 if 'L' in key else 0)\n","\n"," if not model:\n"," model = BTCModel(data_path, reviews_path, random_forest=False, use_extended_features=extended_features)\n","\n"," if date:\n"," prediction = model.predict(date=date, use_api=use_api == 'y')\n"," else:\n"," prediction = model.predict(user_input=user_input, use_api=use_api == 'y')\n","\n"," if use_api == 'y':\n"," print(f\"Nuspėjama modelio su API BTC kaina rytdienai --> {prediction:,.2f} USD <--\")\n"," else:\n"," print(f\"Nuspėjama modelio BTC kaina šiam laikotarpiui ({user_input['Year']}-{user_input['Month']}-{user_input['Day']}) --> {prediction:,.2f} USD <--\")\n","\n"," user_db.save_user_input(user_input)\n","\n","if __name__ == \"__main__\":\n"," main()\n"]}],"metadata":{"kernelspec":{"display_name":"mokymai","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.8.10"},"colab":{"provenance":[]}},"nbformat":4,"nbformat_minor":0}