/********************************************************* Alexis C. Montenegro © March 2006 Use and/or modify this code freely. If you redistribute it please include this and/or any other comment blocks and a description of any changes you make. **********************************************************/ // NOTE: // This efs requires Parabolic.efsLib in the FunctionLibrary folder. // If you do not have this file you can download it at the link below. // http://share.esignal.com/groupcontents.jsp?folder=Formulas-Libraries&groupid=10 var fpArray = new Array(); function preMain(){ setPriceStudy(true); setStudyTitle("Parabolic") setCursorLabelName("Parabolic"); setPlotType(PLOTTYPE_DOT); setDefaultBarThickness(2); var x=0; fpArray[x] = new FunctionParameter("AF", FunctionParameter.NUMBER); with(fpArray[x++]){ setLowerLimit(0); setDefault(0.02); } fpArray[x] = new FunctionParameter("AFMax", FunctionParameter.NUMBER); with(fpArray[x++]){ setLowerLimit(0); setDefault(0.2); } fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING); with(fpArray[x++]){ setDefault(); } fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN); with(fpArray[x++]){ setName("Show Parameters"); setDefault(false); } } var amLib = addLibrary("Parabolic.efsLib"); var bInit = false; var xParabolic = null; function main(AF,AFMax,Interval,Params){ if(bInit==false){ with ( amLib ){ if(Interval == null) Interval = getInterval(); var vInterval = Interval; xParabolic = getSeries(amParabolic(AF,AFMax,inv(vInterval))); setShowTitleParameters(eval(Params)); bInit=true; } } var nParabolic = xParabolic.getValue(-1);//see Note1 and Note2 below return nParabolic; } //Note1: //Replace xParabolic.getValue(-1) with xParabolic.getValue(0) //to plot the current value of the Parabolic study //Note2 //Replace xParabolic.getValue(-1) with xParabolic //to plot current value of the Parabolic study and wish to //maintain full synchronization when using multiple intervals