Got my algorithm working, but I want to add more. I am looking at Benjamin Graham Fundamentals, and trying to find value in the mkt. I buy on the 3rd day of the month 10 stocks.
I have a function trail_stop, and this contains my trailing stop for the stocks. The stop works well, but when I lose too many orders I lose my leverage, since I only buy at the start of the month. This gives too much time for no return.
My goal would, obviously, be to refill those orders with either other stocks in my pipeline, or some kind of hedge system. Right now, I am shorting the VXX on a moving average.
If the leverage is calculated everyday in the function count_positions, then why can I not
And find the hedge that makes my algorithm 1.0?