Dear Community,
First of all, I would like to say that I am an absolute beginner when it comes to backtesting my trading strategies. Nevertheless, I would be very happy about feedback and suggestions for improvement - because I believe that some errors have crept into my code.
Trading algorithm
I use two signals, the FinSents Sentiment signals and my own sentiment signals based on a sentiment analysis of newspaper articles. These should now be used to make long or short decisions. I only use three companies for my portfolio - this should be extended though.
Current Problems
I have a few questions about the weighting for each company: If I set the weighting to 1.0 or -1.0 for each company, then the return is much higher than if I make an equal weighting, for example, 0.33 or -0.33 for each company in the case of three companies. Unfortunately, I do not fully understand the weighing mechanism, as it is not just only one signal used for every company, but two signals for some companies. Does the weighting even play a role for the signal used in the algorithm or can there be multiple weightings for one company?
Another question that is not quite clear to me is how I can best and easiest implement the long and short strategy for every company. Does this really have to be done individually for each company, or is there a better function for this?
At the moment, according to my algorithm, the return is far too high (which would be nice, of course), but I don't think that's realistic. I would be very happy if you could point out my mistakes in my code because I think that such an algorithm could come to very good results if it would be implemented correctly.
I hope someone can help me with my problem.