Which of the following approaches is a more efficient use of resources?
(1)
var bb = new BollingerStudy(20, "Close", 2.0);
function main() {
var ub = bb.getValue("BollingerStudy.UPPER);
var db = bb.getValue("BollingerStudy.LOWER);
...
}
or,
(2)
function main() {
var ub = upperBB(20,2.0);
var db = lowerBB(20,2.0);
...
}
and why? Thanks,
++Ayman
(1)
var bb = new BollingerStudy(20, "Close", 2.0);
function main() {
var ub = bb.getValue("BollingerStudy.UPPER);
var db = bb.getValue("BollingerStudy.LOWER);
...
}
or,
(2)
function main() {
var ub = upperBB(20,2.0);
var db = lowerBB(20,2.0);
...
}
and why? Thanks,
++Ayman
Comment