In entryprice= MvgAvg(10 Bar, Close) you must put a lag other wise you are forward looking. entryprice= MvgAvg(10 Bar, Close, 1)
Thanks Sergio. I changed it to a 1 bar lag and confirmed that that is indeed more honest and not forward looking since when it was pasted to my chart as an indicator, it's value at Bar 0 (right most ) did not change as the "close mark" went all over the place since it is still the made.