Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() | Got your email and got you registered in TradeTight :~) I doubt that a for-next is needed for the algorithm at the link I posted. Just three variables for the prior bars' values. Then, at the end of your code after the calcs for the current bar, just "increment" them so that the next bar in the outer implicit (parser) loop has updated "lookbacks" ... parameters ... declarations ... calculations ... Var3Bago = Var2Bago Var2Bago = Var1Bago Var1Bago = VarThisB return |