cl7805
cl7805
This code is a snippet from Lopez De Prado Advances in Financial Machine Learning page 44 def getDailyVol(close,span0=100): # daily vol reindexed to close df0=close.index.searchsorted(close.index-pd.Timedelta(days=1)) df0=df0[df0>0] df0=(pd.Series(close.index[df0-1], index=close.index[close.shape[0]-df0.shape[0]:])) try: df0=close.loc[df0.index]/close.loc[df0.values].values-1...
Hi, marvellous explanation above. The example given in the book is intraday. I'm doing swing trading amd I'm stuck on the distinction between Timedelta and span. What does span=100 mean?...
Hi, The above doesn't load. Please advise. Thanks
Hi, I'm encountering an error in the following lines: except CplexError, exc: print exc return I have installed cplex and I'm using python 3.7. I will iterate the codes. Thks,...
Import the required modules import backtrader as bt import yfinance as yf Download data from yfinance data = yf.download("AAPL", period="max") Convert the data to a Pandas DataFrame data = pd.DataFrame(data)...