var myUpArray = new Array(5); myUpArray[0] = new Array(2); myUpArray[1] = new Array(2); myUpArray[2] = new Array(2); myUpArray[3] = new Array(2); myUpArray[4] = new Array(2); var upsuccess = 0; var gLoc = 20; var oldUpPoint = 0; var gUpPoint = 0; function preMain( ) { setPriceStudy( true ); setColorPriceBars(true); } function main() { var txtFlags = Text.ONTOP | Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM; if ( isLastBarOnChart() && ( getBarState( ) == BARSTATE_NEWBAR )) { gLoc = 20; for(var i=0; i >= -65; --i ) { if ((high(i-3) >= high(i-2))) { drawShapeRelative(i-3, high(i-3)+.0002, Shape.DOWNARROW, "", Color.blue, null, "buyShp" + i+getValue("time")); drawTextRelative(i-3, high(i-3) + .0003, high(i-3), Color.blue, Color.white, Text.BOLD | Text.ONTOP, null, null, "buyTxt" + gLoc+getValue("time")); gUpPoint = high(i-3); debugPrintln("1: \t" + upsuccess); myUpArray[upsuccess][0] = gUpPoint; myUpArray[upsuccess][1] = (i-3); drawTextAbsolute(105, 600 - gLoc, "i is " + (i-3) + " high is " + high(i-3) + " success is " + upsuccess + " and gLoc is " + gLoc + " lineID = " + gLoc, Color.blue, null, txtFlags, null, 11, gLoc); gLoc = gLoc + 20; upsuccess++; oldUpPoint = gUpPoint; } } } upsuccess = 0; }