This file contains hidden or 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
plot <- gapminder %>% | |
filter(year == 2007) %>% | |
ggplot() + | |
labs( | |
x = "GDP per Capita", | |
y = "Life Expectancy", | |
color = "Population in millions", | |
size = "Population in millions" | |
) + | |
theme_minimal() |
This file contains hidden or 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
#install.packages(c("tidyverse", "gapminder", "MetBrewer")) | |
library(tidyverse) | |
library(gapminder) | |
library(MetBrewer) |
This file contains hidden or 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
fig = ( | |
go.Figure( | |
data = [ | |
go.Candlestick( | |
x = df_klines['opentime'], | |
open = df_klines['open'], | |
high = df_klines['high'], | |
low = df_klines['low'], | |
close = df_klines['close'] | |
) |
This file contains hidden or 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
klines = client.get_historical_klines("BNBBTC", Client.KLINE_INTERVAL_1HOUR, "1 day ago UTC") | |
df_klines = pd.DataFrame(klines) | |
df_klines.columns = ['opentime', 'open', 'high', 'low', 'close', 'volume', 'closetime', 'quoteassetvolume', 'numberoftrades', 'tbuybase', 'tbuyquote', '_'] | |
df_klines |
This file contains hidden or 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
{'symbol': 'BNBBTC', | |
'priceChange': '0.00144900', | |
'priceChangePercent': '20.912', | |
'weightedAvgPrice': '0.00792562', | |
'prevClosePrice': '0.00692800', | |
'lastPrice': '0.00837800', | |
'lastQty': '0.38000000', | |
'bidPrice': '0.00837700', | |
'bidQty': '54.80400000', | |
'askPrice': '0.00837800', |
This file contains hidden or 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
ticker = client.get_ticker(symbol = "BNBBTC") | |
ticker |
This file contains hidden or 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
tickers = client.get_ticker() | |
pd.DataFrame(tickers) |
This file contains hidden or 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
{'mins': 5, 'price': '0.00835585'} |
This file contains hidden or 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
client.get_avg_price(symbol = "BNBBTC") |
This file contains hidden or 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
{'symbol': 'BNBBTC', | |
'status': 'TRADING', | |
'baseAsset': 'BNB', | |
'baseAssetPrecision': 8, | |
'quoteAsset': 'BTC', | |
'quotePrecision': 8, | |
'quoteAssetPrecision': 8, | |
'baseCommissionPrecision': 8, | |
'quoteCommissionPrecision': 8, | |
'orderTypes': ['LIMIT', |