I have failed in my 82nd attempt to complete the following and seek some assistance.
Below is the 123up.efs study.
Is it possible to modify this formula to output "the sum of times L>L(-1)" during a 10-day period, and plot it as a simple line indicator? (yup, that's it...)
Thanks for any help.
function preMain() {
setStudyTitle("123Up");
setCursorLabelName("123Up");
setPriceStudy(false)
var fp1 = new FunctionParameter("nBars", FunctionParameter.NUMBER);
fp1.setName("Number of Bars");
fp1.setLowerLimit(1);
fp1.setDefault(10);
}
/*
* This functions shows when there are 3 or more up bars with higher lows
* It is a pure color study.
*/
function main(nBars) {
var i = 0;
var nStateTotal = 0;
if(low(-nBars) == null) return;
for(i = 0; i < nBars-1; i++) {
if(low(-i) >= low(-i-1)) {
nStateTotal = nStateTotal + 1;
} else {
break;
}
}
if(nStateTotal == 0) {
return ????
}
return;
}
Below is the 123up.efs study.
Is it possible to modify this formula to output "the sum of times L>L(-1)" during a 10-day period, and plot it as a simple line indicator? (yup, that's it...)
Thanks for any help.
function preMain() {
setStudyTitle("123Up");
setCursorLabelName("123Up");
setPriceStudy(false)
var fp1 = new FunctionParameter("nBars", FunctionParameter.NUMBER);
fp1.setName("Number of Bars");
fp1.setLowerLimit(1);
fp1.setDefault(10);
}
/*
* This functions shows when there are 3 or more up bars with higher lows
* It is a pure color study.
*/
function main(nBars) {
var i = 0;
var nStateTotal = 0;
if(low(-nBars) == null) return;
for(i = 0; i < nBars-1; i++) {
if(low(-i) >= low(-i-1)) {
nStateTotal = nStateTotal + 1;
} else {
break;
}
}
if(nStateTotal == 0) {
return ????
}
return;
}
Comment