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
# Licensed under the MIT License. See comment below for full licence information. | |
import requests | |
import pandas as pd | |
from datetime import date, datetime, timedelta | |
import time | |
def pull_1m_data(symbol, date): |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import vectorbt as vbt | |
import yfinance as yf | |
import pandas as pd | |
from datetime import datetime, timedelta | |
import talib |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import pandas as pd | |
from backtesting import Backtest, Strategy | |
from backtesting.test import GOOG | |
import math | |
class DCA(Strategy): |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import json | |
import requests | |
import pandas as pd | |
import datetime | |
start = "2021-11-01" | |
end = "2021-11-10" |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import pandas as pd | |
""" | |
df = pd.read_csv("minute-data.csv")[["unix","open","high","low","close","volume"]] | |
df["date"] = pd.to_datetime(df["unix"], unit = "s") | |
df.set_index("date", inplace=True) |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import pandas as pd | |
import yfinance as yf | |
df = yf.Ticker("BTC-USD").history(period = "1d", interval = "1m") | |
print(df) |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import mplfinance as mpl | |
import pandas as pd | |
import yfinance as yf | |
## Data Gather | |
btc = yf.Ticker("BTC-USD").history(period = "1mo", interval = "60m") | |
print(btc) |
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
# Licensed under the MIT License. See comment below for full licence information. | |
from datetime import datetime | |
import backtrader as bt | |
class OverUnderIndicator(bt.Indicator): | |
lines = ('overunder',) | |
def __init__(self): |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import backtrader as bt | |
from datetime import datetime | |
class SwingTrade(bt.SignalStrategy): | |
params = (("closeThreshold",3),) | |
def __init__(self): |
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
# Licensed under the MIT License. See comment below for full licence information. | |
import pandas as pd | |
import pandas_ta as ta | |
import matplotlib.pyplot as plt | |
import plotly.graph_objects as go | |
df = pd.read_csv("btc.csv")[["unix","open","high","low","close"]] | |
df.sort_values(by="unix", inplace = True) | |
df["date"] = pd.to_datetime(df["unix"], unit = 's') |
NewerOlder