//@Name:High-Low //@Description:Draws the average difference between the High & Low // Care has been taken in preparing this code but it is provided without guarantee. // You are welcome to modify and extend it. Please add your name as a modifier if you distribute it. // Coded by: Phil Tolhurst, ShareScope Support var colour1=Colour.Blue; var period = 5; var outputType = 0; function init(status) { if (status == Loading || status == Editing) { colour1 = storage.getAt(0); period = storage.getAt(1); outputType = storage.getAt(2); } if (status == Adding || status == Editing) { var dlg = new Dialog("Indicator: High-Low", 205, 65); dlg.addOkButton(); dlg.addCancelButton(); dlg.addGroupBox(5,5,120,46,"Indicator settings"); dlg.addIntEdit("INT1",10,15,-1,-1,"","period",period,1,1000); dlg.addColPicker("COL1",75,15,-1,-1,"","",colour1); dlg.addDropList("DL1",40,32,70,-1,["Absolute Value","% of Close"],"Output","",outputType) if (dlg.show() == Dialog.Cancel) return false; colour1 = dlg.getValue("COL1"); period = dlg.getValue("INT1"); outputType = dlg.getValue("DL1"); storage.setAt(0, colour1); storage.setAt(1, period); storage.setAt(2, outputType); } setTitle(period+" High-Low"); setSeriesColour(0, colour1); setSeriesChartType(0,ChartType.Histogram) } function getGraph(share, data) { var output = new Array(); var ma1= new MA(period); for (var i=0;i