If I apply the following code on a daily chart, i.e. ($SPX, D), it doesn't work. However if I change the value of n to smaller value, for example, n = 5, then vC shall be printed out. I have been aware of this problem for quite a long time. Is there some good solution to this problem? If I run this code on (QQQ, 60) chart with enough bars on the chart, then there is no problem at all even if n is set to 60. In a lot of scenarios, esignal just quitely stops the execution of the efs if some problems like this one apear in the efs. I think it should at least gives some runtime warning about this.
Clearpicks
var i;
var vC;
function preMain(){
setPriceStudy(true);
}
function main(){
if ( getBarState() == BARSTATE_ALLBARS ) {
}
if ( getCurrentBarIndex() == 0 ) {
var n = 60;
vC = getValueAbsolute("Close", 0, -n, "QQQ,60");
debugPrintln(vC);
}
}
Clearpicks
var i;
var vC;
function preMain(){
setPriceStudy(true);
}
function main(){
if ( getBarState() == BARSTATE_ALLBARS ) {
}
if ( getCurrentBarIndex() == 0 ) {
var n = 60;
vC = getValueAbsolute("Close", 0, -n, "QQQ,60");
debugPrintln(vC);
}
}
Comment