I am fairly new to python and I am struggling to put my idea into code. Using a Notebook I want to create a customfactor that I can use in a pipeline to return some stocks.
I want to create a customfactor that counts the number of Up days (days with positive returns) over the past 126 days.
So say stock ABC has had 100 up days in the past 126 days. I want to create a customfactor that would return the number 100
I want to do this in a Notebook.
If anyone knows how to do this in a Notebook your help would be greatly appreciated!