Time Frames
Good Morning,
Thank you for explaining the operation of the time interval moving averages.
Based on the custom moving average in the custom EFS2 folder, I have tested several options using the "menu" features for conveniently changing variables. I would now like to convert this code to the lease amount of lines of coding to stream line a custom EFS which has many moving averages. The following is an attempt to do so, however the interval does not respond when changed in the EFS indicating the structure of the formula is incorrect. I would like to define all variables in the
xMA EFS formula and not go through the edit studies or menues. Could someone please suggest the corrections to the following EFS coding to allow for proper operation?
Best Regards,
Alan
/************************************************** *******
By Alexis C. Montenegro for eSignal © December 2004
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.
The following has been streamlined.
************************************************** ********/
function preMain() {
setPriceStudy(true);
setStudyTitle("MAmod");
setCursorLabelName("MAmod",0);
setDefaultBarFgColor(Color.blue,0);
setPlotType(PLOTTYPE_LINE,0);
setDefaultBarThickness(1,0);
}
var xMA = null;
function main(Type,Length,Source,Symbol,Interval,Offset,Par ams) {
xMA = offsetSeries(eval(sma)(3,eval(close)(sym("YM M5","17t"))),-3);
return getSeries(xMA);
}
Good Morning,
Thank you for explaining the operation of the time interval moving averages.
Based on the custom moving average in the custom EFS2 folder, I have tested several options using the "menu" features for conveniently changing variables. I would now like to convert this code to the lease amount of lines of coding to stream line a custom EFS which has many moving averages. The following is an attempt to do so, however the interval does not respond when changed in the EFS indicating the structure of the formula is incorrect. I would like to define all variables in the
xMA EFS formula and not go through the edit studies or menues. Could someone please suggest the corrections to the following EFS coding to allow for proper operation?
Best Regards,
Alan
/************************************************** *******
By Alexis C. Montenegro for eSignal © December 2004
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.
The following has been streamlined.
************************************************** ********/
function preMain() {
setPriceStudy(true);
setStudyTitle("MAmod");
setCursorLabelName("MAmod",0);
setDefaultBarFgColor(Color.blue,0);
setPlotType(PLOTTYPE_LINE,0);
setDefaultBarThickness(1,0);
}
var xMA = null;
function main(Type,Length,Source,Symbol,Interval,Offset,Par ams) {
xMA = offsetSeries(eval(sma)(3,eval(close)(sym("YM M5","17t"))),-3);
return getSeries(xMA);
}
Comment