Thanks so much for pointing that out! Im glad to join this community.
I just realised that there is a binary flag that I can set to. Is this the right way to set a flag?
And also will optimize() work in Binary? Currently it does not work for me.
function run()
{
set(BINARY);
//WinPayout=0.8;
//Spread=0;
StartDate = 2015;
EndDate = 2016;
BarPeriod = 5;
// calculate the buy/sell signal
vars C0 = series(priceClose());
vars RSI0 = series(RSI(C0, 14));
var Threshold = optimize(70,70,80,1);
var Threshold2 =optimize(30,30,20,-1);
ExitTime = 2;
if(crossUnder(RSI0,Threshold2))
enterLong();
else if(crossOver(RSI0,Threshold))
enterShort();
}