true==function() { var MA=function(period){ var price=[ih][0].PClosing ; var N=period-1 ; var n ; var t; for(n=1;n<=N;n++) price=[ih][n].PClosing + price ; if(n=N) price = price /(n+1) ; return price ; }; var CalculatePivotPoint=function(Period, HL){ var MaxHigh = (pmax); var MinLow = (pmin); var MaxClose = (pl); if(Period >1) for (var i = 0; i < Period-1 ; i++) { if([ih][i].PriceMax > MaxHigh) MaxHigh = [ih][i].PriceMax; if([ih][i].PriceMin < MinLow) MinLow = [ih][i].PriceMin; } x = (MaxHigh+ MinLow) / 2; y = (MaxHigh+MinLow+ MaxClose)/3; w= Math.abs(x-y); PH = y+w; PL = y-w; if(HL == 0) return PL; else return PH; }; (cfield0) = MA(10); (cfield1) = MA(20); (cfield2) = MA(30); PRE5H = CalculatePivotPoint(5, 1); PRE1L = CalculatePivotPoint(1, 0); PRE1H = CalculatePivotPoint(1, 1); PRE5L = CalculatePivotPoint(5, 0); if((pl) > (cfield0) && (cfield0) > (cfield1) && (cfield1)>(cfield2)) { if(PRE1H > PRE5H && PRE1L > PRE5H && (pl) > PRE1H ){ t = "WL"; return true; } else{ t = ""; return false; } } else { return false; } }()