This is the code for EFS built in moving average Envelope..
/################################
var study = new EnvelopeStudy(20, 0, "Close", false, 0.25);
function preMain() {
setPriceStudy(true);
setDefaultBarFgColor(Color.blue, 0); // upper
setDefaultBarFgColor(Color.red, 1); // basis
setDefaultBarFgColor(Color.blue, 2); // lower
}
function main() {
var vUpper = study.getValue(EnvelopeStudy.UPPER);
var vBasis = study.getValue(EnvelopeStudy.BASIS);
var vLower = study.getValue(EnvelopeStudy.LOWER);
return new Array(vUpper, vBasis, vLower);
/################################
The above has a 20 period mov ave, with upper and lower bands based on 2.5% of the basis mov ave.
My Request : I would like to have another upper and another lower band based on 2.5% *2 = %5.0 from basis mov ave.
Thus 5 lines, or 4 bands on the basis
Upper1 =+5.0%
Upper=+2.5%
Basis = 20 mov ave
Lower=-2.5%
Lower1=-5.0%
I am very new to this EFS code, could some one please provide the code for me ? I seams easy but, I dont have the skills.
Thx in advance
/################################
var study = new EnvelopeStudy(20, 0, "Close", false, 0.25);
function preMain() {
setPriceStudy(true);
setDefaultBarFgColor(Color.blue, 0); // upper
setDefaultBarFgColor(Color.red, 1); // basis
setDefaultBarFgColor(Color.blue, 2); // lower
}
function main() {
var vUpper = study.getValue(EnvelopeStudy.UPPER);
var vBasis = study.getValue(EnvelopeStudy.BASIS);
var vLower = study.getValue(EnvelopeStudy.LOWER);
return new Array(vUpper, vBasis, vLower);
/################################
The above has a 20 period mov ave, with upper and lower bands based on 2.5% of the basis mov ave.
My Request : I would like to have another upper and another lower band based on 2.5% *2 = %5.0 from basis mov ave.
Thus 5 lines, or 4 bands on the basis
Upper1 =+5.0%
Upper=+2.5%
Basis = 20 mov ave
Lower=-2.5%
Lower1=-5.0%
I am very new to this EFS code, could some one please provide the code for me ? I seams easy but, I dont have the skills.
Thx in advance
Comment