Failing notebook

Course Name: Advanced Momentum Trading: Machine Learning Strategies, Section No: 21, Unit No: 7, Unit type: Notebook

The code provided in the Performance analysisd part is not working and is generating errors

Hi Jerome,



Thankyou for pointing this out, this has been fixed!

Hi Rushda,



I retried and I am still getting the error.

screenshot



The issue is related to the Signal row that should be called signal in the combined_strategy dataframe 

 

# Generate signals
combined_strategy['signal'] = np.where((combined_strategy['ML_signal'] == 1) & (
    combined_strategy['TSMOM_signal'] == 1), 1, 0)
combined_strategy['signal'] = np.where((combined_strategy['ML_signal'] == -1) & (
    combined_strategy['TSMOM_signal'] == -1), -1, combined_strategy['signal'])

Another issue in the last part:

# Performance Metrics
performance = performance_metrics(combined_strategy, trade_sheet)


Should be changed to:
# Performance Metrics
performance = performance_metrics(combined_strategy)
 

Yes Jerome, all the changes have been implemented, but it may take some time before you see them on your end.