I can't get past the following as I keep getting a syntax error. It should be a fairly simple mean reversion script but I can't figure out what is the syntactical error in the declaration of my absolute price difference variable.
vars Close = series(priceClose());
vars SMA200 = series(SMA(Close,200));
vars SMA20 = series(SMA(Close,20));
vars Price_diff200 = series((abs(Close - SMA200) / float(Close)) * 100.0);
if(Price_diff200 > 2.0)
if(SMA20 < SMA200)
else if(SMA20 > SMA200)
Re: Syntax error - series with math operations
Ha, not doing matrix homework problem. Just trying to follow the conversation. I first learned Python and then R. Things that work in those languages don't work and the compiler error wasn't helping direct me to a stack overflow or tutorial that I could quickly diagnose the error.
Also, because I'm not a coder by trade, I sometimes phrase things less precisely than I should.
Thanks for the help and I'll definitely read up on those two links!