Autodidact's Paradox
New member
Hi All -
Having some trouble coding up something to use as part of a scanning tool.
I'm wanting to multiply gross monthly returns and end up with a cumulative net return for the lookback period (e.g.: +1.5% return from stock ABC last month with a -2.0% return from ABC the month prior, we have (1 + 0.015)(1 - 0.02) - 1= -0.53% for that 2 month period) as a part of a momentum model I'm putting together.
The lookback period I intend to use is going back 12 months, but I want to exclude the most recent month. My hunch is that some clean script can be written recursively, but I'm having trouble getting it together (after days of research and attempts).
Once built out, the intention is to use it as part of a scan so that the stocks with the highest cumulative net return for that lookback period can be identified.
I greatly appreciate any input, and thank you kindly for taking the time/effort.
Having some trouble coding up something to use as part of a scanning tool.
I'm wanting to multiply gross monthly returns and end up with a cumulative net return for the lookback period (e.g.: +1.5% return from stock ABC last month with a -2.0% return from ABC the month prior, we have (1 + 0.015)(1 - 0.02) - 1= -0.53% for that 2 month period) as a part of a momentum model I'm putting together.
The lookback period I intend to use is going back 12 months, but I want to exclude the most recent month. My hunch is that some clean script can be written recursively, but I'm having trouble getting it together (after days of research and attempts).
Once built out, the intention is to use it as part of a scan so that the stocks with the highest cumulative net return for that lookback period can be identified.
I greatly appreciate any input, and thank you kindly for taking the time/effort.