@Veasnar of course there is no error with compilation. You entered a mathematical equation. What you need is to familiar with the Ref function to refer to yesterday (or previous bar's) http://www.amibroker.com/guide/afl/ref.html
If you are uncertain about what your calculations are creating then create an Exploration and see what all your variables are doing.
But also even though you have been a member of the forum for 10 months, you do not appear to have gone through some important steps in learning afl. I suggest you spend some significant time reading and coding what you find as you work your way through the resources listed in this forum post,