백테스팅 툴


백테스팅 툴

from pykrx import stock import datetime import numpy as np import pandas as pd from dateutil.parser import parse import time import matplotlib.pyplot as plt start = '20100101' end = '20210617' df = stock.get_market_ohlcv_by_date(fromdate = start, todate = end, ticker='005930') del df['거래량'] short_ema = df['종가'].ewm(span = 12).mean() long_ema = df['종가'].ewm(span = 26).mean() macd = round(short_ema - long_ema,2) signal = macd.ewm(span =9).mean() df['macd'] = macd df['macd_osc'] = round(macd - sign...



원문링크 : 백테스팅 툴