Utilize new daily data retrieval in strategies that depend on secondary data sources
This commit is contained in:
parent
d10a889e9b
commit
54ee48af3b
@ -2,7 +2,7 @@ import numpy as np
|
|||||||
|
|
||||||
from pandas import DataFrame, Series
|
from pandas import DataFrame, Series
|
||||||
|
|
||||||
from ohlc import ohlc
|
from daily_data import get_daily_data
|
||||||
|
|
||||||
def calculate_rsi(data: DataFrame, period: int = 2) -> Series:
|
def calculate_rsi(data: DataFrame, period: int = 2) -> Series:
|
||||||
"""
|
"""
|
||||||
@ -34,7 +34,7 @@ def signals(data: DataFrame) -> Series:
|
|||||||
|
|
||||||
start_date = data['Date'].min()
|
start_date = data['Date'].min()
|
||||||
end_date = data['Date'].max()
|
end_date = data['Date'].max()
|
||||||
trin_data = ohlc(symbol = 'RINT.Z', start_date = start_date, end_date = end_date)
|
trin_data = get_daily_data(symbol = 'RINT.Z', start_date = start_date, end_date = end_date)
|
||||||
|
|
||||||
trin_above_1 = trin_data['Close'] > 1
|
trin_above_1 = trin_data['Close'] > 1
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from pandas import DataFrame, Series
|
from pandas import DataFrame, Series
|
||||||
|
|
||||||
from ohlc import ohlc
|
from daily_data import get_daily_data
|
||||||
|
|
||||||
def signals(data: DataFrame) -> Series:
|
def signals(data: DataFrame) -> Series:
|
||||||
"""
|
"""
|
||||||
@ -12,7 +12,7 @@ def signals(data: DataFrame) -> Series:
|
|||||||
|
|
||||||
start_date = data['Date'].min()
|
start_date = data['Date'].min()
|
||||||
end_date = data['Date'].max()
|
end_date = data['Date'].max()
|
||||||
vix_data = ohlc(symbol='VIX.XO', start_date=start_date, end_date=end_date)
|
vix_data = get_daily_data(symbol='VIX.XO', start_date=start_date, end_date=end_date)
|
||||||
|
|
||||||
vix_15_day_high = vix_data['High'] == vix_data['High'].rolling(window = 15).max()
|
vix_15_day_high = vix_data['High'] == vix_data['High'].rolling(window = 15).max()
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import numpy as np
|
|||||||
|
|
||||||
from pandas import DataFrame, Series
|
from pandas import DataFrame, Series
|
||||||
|
|
||||||
from ohlc import ohlc
|
from daily_data import get_daily_data
|
||||||
|
|
||||||
def calculate_rsi(data: DataFrame, period: int = 2) -> Series:
|
def calculate_rsi(data: DataFrame, period: int = 2) -> Series:
|
||||||
"""
|
"""
|
||||||
@ -29,7 +29,7 @@ def signals(data: DataFrame) -> Series:
|
|||||||
|
|
||||||
start_date = data['Date'].min()
|
start_date = data['Date'].min()
|
||||||
end_date = data['Date'].max()
|
end_date = data['Date'].max()
|
||||||
vix_data = ohlc(symbol = 'VIX.XO', start_date = start_date, end_date = end_date)
|
vix_data = get_daily_data(symbol = 'VIX.XO', start_date = start_date, end_date = end_date)
|
||||||
|
|
||||||
vix_rsi_2 = calculate_rsi(vix_data, period = 2)
|
vix_rsi_2 = calculate_rsi(vix_data, period = 2)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user