November 2019
Beginner
394 pages
10h 31m
English
In this more advanced trading strategy, we are going to create a long signal when the price reaches the highest price for the last window_size days (in this example, we will choose 50):
def turtle_trading(financial_data, window_size): signals = pd.DataFrame(index=financial_data.index) signals['orders'] = 0 # window_size-days high signals['high'] = financial_data['Adj Close'].shift(1).\ rolling(window=window_size).max() ...