PassInputsToStudy.efs
File Name: PassInputsToStudy.efs
Description:
This help formula outlines a method for passing user inputs from the "Edit Studies" option to change the parameters of a Moving Average study.
Formula Parameters:
- Input Parameter: Default value
- nLength: 21
- nOffset: 0
- nPriceSorce: C
- valid iputs: O, H, L and C
- nType: MAStudy.SIMPLE
- valid inputs: MAStudy.SIMPLE, MAStudy.EXPONENTIAL, MAStudy.WEIGHTED and MAStudy.VOLUMEWEIGHTED
Notes:
NA
Download File:
PassInputsToStudy.efs
EFS Code:
/***************************************************************** Provided By : eSignal. (c) Copyright 2003 *****************************************************************/ function preMain() { setPriceStudy(true); } var study = null; function main(nLength, nOffset, nPriceSource, nType) { if (study == null) { //check for valid inputs if (nLength == null) nLength = 21; if (nOffset == null) { nOffset = 0; } else { nOffset = Math.round(nOffset); } if (nPriceSource == null) { nPriceSource = "C"; } else if(nPriceSource == "C" || nPriceSource == "O" || nPriceSource == "H" || nPriceSource == "L") { nPriceSource = nPriceSource; } else { nPriceSource = "C"; } if (nType == null) { nType = "MAStudy.SIMPLE"; } else if(nType == "MAStudy.EXPONENTIAL" || nType == "MAStudy.SIMPLE" || nType == "MAStudy.WEIGHTED" || nType == "MAStudy.VOLUMEWEIGHTED") { nType = nType; } else { nType = "MAStudy.SIMPLE"; } study = new MAStudy(nLength, nOffset, nPriceSource, eval(nType)); } var vValue = study.getValue(MAStudy.MA); if (vValue == null) return; return vValue; }