//@Name:High - Low Lines //@Description:Draws lines at the High and Low value for the current day on the Intrady chart. //@Type:Intraday var colour1 = Colour.Green; var width1 = 1; var style1 = 0; var colour2 = Colour.Red; var width2 = 1; var style2 = 0; function init(status) { if (status == Loading || status == Editing) { colour1 = storage.getAt(0); width1 = storage.getAt(1); style1 = storage.getAt(2); colour2 = storage.getAt(3); width2 = storage.getAt(4); style2 = storage.getAt(5); } if (status == Adding || status == Editing) { var dlg = new Dialog("High and Low Line settings",150, 50); dlg.addOkButton(); dlg.addCancelButton(); dlg.addColLinePicker("VAL1",40,5,-1,-1,"High Line","",colour1,style1,width1); dlg.addColLinePicker("VAL2",40,22,-1,-1,"Low Line","",colour2,style2,width2); if (dlg.show() == Dialog.Cancel) return false; colour1 = dlg.getValue("VAL1").colour; style1 = dlg.getValue("VAL1").pen; width1 = dlg.getValue("VAL1").width; colour2 = dlg.getValue("VAL2").colour; style2 = dlg.getValue("VAL2").pen; width2 = dlg.getValue("VAL2").width; storage.setAt(0, colour1); storage.setAt(1, width1); storage.setAt(2, style1); storage.setAt(3, colour2); storage.setAt(4, width2); storage.setAt(5, style2); } setSeriesColour(0, colour1); setSeriesLineStyle(0, style1, width1 ); setSeriesColour(1, colour2); setSeriesLineStyle(1, style2, width2); setRange(Range.Parent); } function getGraph(share, data) { var highVal = share.getIMidHigh(); var lowVal = share.getIMidLow(); var highLine = []; var lowLine = []; if (highVal==undefined || lowVal==undefined) { for (var k=0;k