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
# =============================================================== | |
# Imports | |
# =============================================================== | |
# Core Libraries | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import yfinance as yf | |
from scipy.stats import norm, linregress | |
import numpy as np | |
import plotly.graph_objects as go |
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
# =============================================================== | |
# Imports | |
# =============================================================== | |
from datacollection.DataListeners import EventListener | |
from utils.util import get_month_day, Webscraper | |
from utils.KalshiClient import ExchangeClient | |
import asyncio | |
from datetime import datetime | |
from pandas import DataFrame | |
import pandas as pd |
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
# =============================================================== | |
# Imports | |
# =============================================================== | |
from base_strategy import BaseStrategy | |
from datacollection.DataListeners import EventListener | |
import asyncio | |
import time | |
from utils.util import calc_fees, get_digits | |
from utils.KalshiClientV3 import ExchangeClient | |
import yfinance as yf |
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 asyncio | |
import uuid | |
import math | |
import time | |
from utils.KalshiClient import ExchangeClient | |
from datacollection.DataListeners import EventListener | |
from utils.util import filter_digits, get_month_day, get_hour | |
from datetime import datetime | |
import traceback |
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
# ========================================= | |
# IMPORTS | |
# ========================================= | |
import uuid, time, asyncio | |
from abc import ABC, abstractmethod | |
from utils.util import filter_digits, calc_fees, cut_down | |
from utils.KalshiClientV3 import ExchangeClient | |
from datacollection.DataListeners import EventListener, MarketListener | |
# ========================================= |
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
# ========================================= | |
# IMPORTS & CONFIG | |
# ========================================= | |
import json, asyncio, websockets, base64 | |
from datetime import datetime | |
from cryptography.hazmat.primitives import hashes, serialization | |
from cryptography.hazmat.primitives.asymmetric import padding, rsa | |
from cryptography.exceptions import InvalidSignature | |
from utils.KalshiClient import ExchangeClient | |
from config import WEBSOCKET_ENDPOINT |
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
class Webscraper: | |
def __init__(self): | |
options = webdriver.ChromeOptions() | |
options.add_argument('--headless') | |
self.driver = webdriver.Chrome(options=options) | |
def get_BTC_price(self): | |
endpoint = "https://www.cfbenchmarks.com/data/indices/BRTI?ref=blog.cfbenchmarks.com" | |
self.driver.get(endpoint) | |
return filter_digits(self.driver.find_element(By.CSS_SELECTOR, r'span.text-sm.font-semibold.tabular-nums.md\:text-2xl').text) |
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
# ========================================= | |
# IMPORTS & SETUP | |
# ========================================= | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
import time | |
from bs4 import BeautifulSoup | |
from selenium.webdriver.common.action_chains import ActionChains | |
import re |