//@Name:ATR Title //@Description: Draws the ATR and shows the current value on the Title on the indicator panel // 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=11862016; var width1=0; var pen1=0; var periods=14; function init(status) { if (status == Loading || status == Editing) { colour1 = storage.getAt(0); width1 = storage.getAt(1); pen1 = storage.getAt(2); periods = storage.getAt(3); } if (status == Adding || status == Editing) { var dlg = new Dialog("ndicator: ATR%", 200, 45); dlg.addOkButton(); dlg.addCancelButton(); dlg.addGroupBox(5,5,140,30,"Indicator Properties"); dlg.addIntEdit("INT1",8,15,-1,-1, "","periods",periods,1,999); dlg.addColLinePicker("INT2",80,15,-1,-1,"","",colour1,pen1,width1); if (dlg.show() == Dialog.Cancel) return false; colour1 = dlg.getValue("INT2").colour; pen1 = dlg.getValue("INT2").pen; width1 = dlg.getValue("INT2").width; periods = dlg.getValue("INT1") storage.setAt(0, colour1); storage.setAt(1, width1); storage.setAt(2, pen1); storage.setAt(3, periods); } setSeriesColour(0, colour1); setSeriesLineStyle(0, pen1, width1); } function getGraph(share, data) { var ATRcalc = new ATR(periods); var output = new Array(); for (var i=0;i