Query on "Trading with Machine Learning: Regression" Course

Course Name: Trading with Machine Learning: Regression, Section No: 7, Unit No: 1, Unit type: Video

 

Tested this on different data

1. The Sharpe ratio is negative and total return on strategy is negative. Does this imply an issue with regression ? What does this mean?
2. The return on security on last graph is higher than return on strategy
3. The columns "Max_U" & "Max_D" are always blank for most of the initial population, irrespective of the script I test. Does this imply something ?

Hi Ankit,



1. If the analysis results in a negative Sharpe ratio, it either means the risk-free rate is greater than the portfolio's return, or the portfolio's return is expected to be negative. In either case, a negative Sharpe ratio does not convey any useful meaning. (Resouce). The data you are using, is it negatively correlated? If so, OLS fit won't work and you need to use regression line fitting to find the negative hedge ratio and the intercept and make changes to the portfolio value function accordingly.



2. The green line, return for strategy, is higher than the red line, return for the security. That indicates your strategy is outperforming the benchmark(in this case the underlying security), which is desirable. Did you imply this or the other way around?



3. It is split into test and train data as shown in the Notebook. Max_U and Max_D are populated for the test data. There is no point in populating values of Max_U and Max_D for training data since we are not making predictions for that part of the data set.



Hope this helps!

Hi


  1. Am running it on Nifty data and wouldnt expect a negative correlation. Is there a way I can send you the excel file for you to review ?


  2. The return on startegy is lower than the return on security… thats what is the issue


  3. Point clear… thanks for clarification



    thanks  

Hi,



We have received the CSV file and sent a detailed e-mail with the requisite explanation. 



In brief, the problem is arising because of non-stationarity in the price, mainly during the test period. The algorithm expects the price to behave in a mean-reverting pattern, but in reality, it moved in a trending fashion, hence negative returns.



Please feel free to reach out should there be any further doubts!

Thanks!

Hi Gaurav



Thanks a lot … Appreciate the help !



Did you mail me the file ?

I havent received it yet



thanks

 

Hi Ankit, 

You will be receiving the mail shortly from our team.

Thanks!