the code below works fine if I exclude the if statement
if(barM >= 570 && barM < 960){
}
otherwise it doesn't complete. any ideas?
if(barM >= 570 && barM < 960){
}
otherwise it doesn't complete. any ideas?
Code:
var sessionArray; var ReqLength = 300; function sessionData(){ var sSI = getSymbol() + ",60"; var index = 0; var barM = 0; var nLen = 0; var nClose = 0; var nRawtime = 0; var nHour = 0; var nMinute = 0; sessionArray = new Array(); while(nLen < ReqLength){ nClose = getValue("close", -index, 1, sSI)*1; nRawtime = getValue("rawtime", -index, 1, sSI)*1; nHour = getValue("hour", -index, 1, sSI)*1; nMinute = getValue("minute", -index, 1, sSI)*1; var tmp = new Object; tmp.Close = nClose; tmp.Rawtime = nRawtime; tmp.Hr = nHour; tmp.Mn = nMinute; barM = (tmp.Hr*60)+tmp.Mn; if(barM >= 570 && barM < 960){ sessionArray.push(tmp); ++aLen; } ++index; } }
Comment