/********************************************************************************* Dragonbreath aka Geoff was here **********************************************************************************/ function preMain() { setPriceStudy(true); setStudyTitle("Gap Zones - REQUIRES 900 to 1603 Time Template!"); setCursorLabelName("PD-O", 0); // Today Open setCursorLabelName("TD-O", 1); // Prev Open setDefaultBarStyle(PS_SOLID, 0); setDefaultBarStyle(PS_SOLID, 1); setDefaultBarFgColor(Color.blue, 0); setDefaultBarFgColor(Color.blue, 1); setDefaultBarThickness(2, 0); setDefaultBarThickness(4, 1); setPlotType(PLOTTYPE_FLATLINES, 0); setPlotType(PLOTTYPE_FLATLINES, 1); } var bInit = false; var xOpen = null; var xHigh = null; var xLow = null; var xClose = null; function main() { if(isMonthly() || isWeekly() || isDaily()) return; if(bInit == false){ xOpen = open(inv(453)); xClose = close(inv(453)); bInit = true; } var vOpen = getSeries(xOpen); var vClose = xClose.getValue(-1); if(vOpen == null || vClose == null) return; gap=(vOpen-vClose); gap=rnd(gap,2); if (gap > 0) drawTextPixel(50, 15, "| GAP UP: +"+gap+" |", Color.RGB(255,255,255), Color.RGB(0,0,255), Text.ONTOP, "Arial", 20, "Gap"); if (gap < 0) drawTextPixel(50, 15, "| GAP DOWN: "+gap+" |", Color.RGB(255,255,255), Color.RGB(255,0,0), Text.ONTOP, "Arial", 20, "Gap"); drawTextAbsolute (-5, vOpen, "*Gap Boundary*", Color.black, Color.white, Text.ONTOP | Text.CENTER, "Courier", 8, "TodayOpen" ); drawTextAbsolute (-5, vClose, "*Gap Boundary*", Color.black, Color.white, Text.ONTOP | Text.CENTER, "Courier", 8, "PrevClse" ); return new Array (vOpen,vClose); } //==rnd will round to N digits (thanks TRO for rounding code) function rnd(value, N) { var n; var mult=1; for(n=0;n