OK,
Just trying to write a basic script that goes long when price closes above 13 period EMA and goes short when price closes below 13 period EMA. Not much to it, but I'm getting a syntax error when I test it.
For the life of me, I cannot get this very simple script to compile. It's giving me a syntax error at the enterLong function.
Please have patience and mercy - I am a total newb with scripting at this level. I'm hoping someone can lay eyes on this and say "you missed "insert snarky comment here", idiot!"). It seems to work fine if I comment out beginning at the "else if...portion".
function run()
{
var *Price = series(priceClose());
var *Trend = series(EMA(Price,13));
if(Price<Trend)
enterShort();
Stop = 2*ATR(100);
Profit=100*PIP;
else if(Price>Trend)
enterLong();
Stop = 2*ATR(100);
Profit=100*PIP;
}
Thanks in advance!