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
import yfinance as yf | |
import talib | |
import matplotlib.pyplot as plt | |
# Get symbol OHLC data | |
data = yf.download("BTC-USD", start="2021-10-06", end="2021-10-07", interval = "1m") | |
def RSI(data, window=14, adjust=False): | |
delta = data['Close'].diff(1).dropna() | |
loss = delta.copy() |
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_glob = None | |
class DBConnection: | |
def login(self): | |
global client_glob | |
#client_glob = None | |
if client_glob is None: | |
client_glob = pymongo.MongoClient("mongodb://localhost:27017/") | |
return client_glob | |
def createDB(self, exchange): |
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
import smtplib, ssl | |
import json | |
with open("...//mailDetails.json", 'r') as json_file: | |
config = json.load(json_file) | |
port = 465 # For SSL | |
smtp_server = "smtp.gmail.com" | |
sender_email = config["username"] # Enter your address |
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
import json | |
from unicorn_binance_websocket_api.unicorn_binance_websocket_api_manager import BinanceWebSocketApiManager | |
# channels to record | |
channels = ['kline_1m'] | |
exchangeName = "binance" | |
# Pairs you wish to monitor | |
market = ["ETHUSDT", "BTCUSDT"] | |
# Connection class for Binance |
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
import requests | |
import base64 | |
import json | |
with open('...config.json') as json_file: | |
pythonapp = json.load(json_file) | |
url = "https://tokensquant.com/wp-json/wp/v2/posts" | |
user = "user" |
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
import math | |
import pandas as pd | |
import mongo.mongodb as mongo | |
from binance.client import Client | |
import json | |
exchangeName = "binance" | |
with open('...config.json') as json_file: | |
config = json.load(json_file) |
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
from python_graphql_client import GraphqlClient | |
import time | |
# Start the client with an endpoint. | |
client = GraphqlClient(endpoint="https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2") | |
class Calls: | |
def QueryDB(self, skipnumber): | |
query = """˛˛ | |
{pairs(first:1000, skip:%s){ | |
id | |
reserveUSD |