//@Name:Zero lagging TEMA //@Description:Two zero lagging triple exponential moving averages of the typical price and the Heikin-Ashi close. var periods = 10; var indCol = Colour.Green var indStyle = Pen.Solid; var indWidth = 1; var sigCol = Colour.Magenta var sigStyle = Pen.Solid; var sigWidth = 1; function init(status) { if (status == Loading || status == Editing) { periods = storage.getAt(0); sigPeriod = storage.getAt(1); indCol = storage.getAt(2); indStyle = storage.getAt(3); indWidth = storage.getAt(4); sigCol = storage.getAt(5); sigStyle = storage.getAt(6); sigWidth = storage.getAt(7); } if (status == Adding || status == Editing) { dlg = new Dialog((status==Adding?"Add":"Edit")+" indicator", 165, 55); dlg.addOkButton(); dlg.addCancelButton(); dlg.addIntEdit("INT1",8,5,-1,-1,"","period",periods,2,5000); dlg.addColLinePicker("CL1",65,5,-1,-1,"","",indCol,indStyle,indWidth); dlg.addColLinePicker("CL2",65,25,-1,-1,"","",sigCol,sigStyle,sigWidth); if (dlg.show()==Dialog.Cancel) return false; periods = dlg.getValue("INT1"); indCol = dlg.getValue("CL1").colour; indStyle = dlg.getValue("CL1").pen; indWidth = dlg.getValue("CL1").width; sigCol = dlg.getValue("CL2").colour; sigStyle = dlg.getValue("CL2").pen; sigWidth = dlg.getValue("CL2").width; storage.setAt(0, periods); storage.setAt(2, indCol); storage.setAt(3, indStyle); storage.setAt(4, indWidth); storage.setAt(5, sigCol); storage.setAt(6, sigStyle); storage.setAt(7, sigWidth); } setSeriesColour(0,indCol); setSeriesLineStyle(0,indStyle,indWidth); setSeriesColour(1,sigCol); setSeriesLineStyle(1,sigStyle,sigWidth); } function getGraph(share, data) { var ma1 = new MA(periods, MA.Exponential); var ma2 = new MA(periods, MA.Exponential); var ma3 = new MA(periods, MA.Exponential); var ma4 = new MA(periods, MA.Exponential); var ma5 = new MA(periods, MA.Exponential); var ma6 = new MA(periods, MA.Exponential); var ma7 = new MA(periods, MA.Exponential); var ma8 = new MA(periods, MA.Exponential); var ma9 = new MA(periods, MA.Exponential); var ma10 = new MA(periods, MA.Exponential); var ma11 = new MA(periods, MA.Exponential); var ma12 = new MA(periods, MA.Exponential); var ema1 = new Array(); var ema2 = new Array(); var ema3 = new Array(); var ema4 = new Array(); var ema5 = new Array(); var ema6 = new Array(); var ema7 = new Array(); var ema8 = new Array(); var ema9 = new Array(); var ema10 = new Array(); var ema11 = new Array(); var ema12 = new Array(); var temaC = new Array(); //the TEMA of the close var temaT = new Array(); //the TEMA of the TEMA var ZLtema = new Array(); //the zero lagging TEMA of the close var HaO = new Array(); //Heikin-Ashi open var HaC = new Array(); //Heikin-Ashi close var HaTemaC = new Array(); //the TEMA of the Heikin-Ashi close var HaTemaT = new Array(); //the TEMA of the TEMA var HaZLtema = new Array(); //the zero lagging TEMA of the Heikin-Ashi close HaO[0]=0; for (var i=1; i