I would like to count the number of closes below today’s close using a variable look back window. I have coded what I want (below) but it is hard coded to a 7 bar look back. I would like to re-code it to be more flexible (variable look back) but can’t figure out how to do it. Does anyone have a solution?
@rb250660 this is just a minor variation on fxshrat’s solution. You appear to want to chart this so “parameterize” the first line and you can slide the lookback period and watch your graph change as you change the period.