I have a small question about screener optimization, I want to use this code, so I need only the last 20 bar, so I use the IF condition with BarIndex > 1000 (because on the screener I saw he use the last 1024 bar)
the question is : about the variable (MM10 & MM20) I have to declare them inside the condition or outside? Does it change anything about the optimization?