Hey Nico Xenox ! Your service is always greatly appreciated.
I am sorry to report back and say that this does the same thing and has the same issue as before. I am not exiting my short position or buying them back, I am entering a long position at the worst times and using the profits I have from my shorting position to long with.
And now I have two questions for you my friend:
Do you have any other ideas of how to exit a short position?
And,
if your next idea works, how can I combine a longing and shorting strategy together? Is there a way to differentiate the short and long positions in my if statements? I am aware of self.Portfolio.Invested but will it conflate the two rendering it completely useless in a combined algorithm. Because in my if statements, i must be able to say ‘if we are in short position’ and ‘if we are in long position’. Otherwise, I would be getting incorrect entries and notifications constantly.
Thank you so much for your time,
You deserve a raise.
Jesse