The SMA saved to mySMA2 should be producing a value of 5.
Are you doing further assignments on the vByM after it is set to 5?
I recommend that you create a new test script for testing and only add the one series and the one SMA indicator. (Reducing often finds the mistake in the code)

Comment