I want to call this function on the last bar of the chart.
I really do NOT want a series ( it chews up cpu cycles ) but I was following the example I found.
What is the proper call/return?
So far:
And
Thanking You In Advance.
P.S. what this will do is alert me when an instrument rises a threshold amount within a certain number of bars.
I really do NOT want a series ( it chews up cpu cycles ) but I was following the example I found.
What is the proper call/return?
So far:
PHP Code:
if (bInit == false) {
xRocket = efsInternal("fRocket", iBars, close());
xTank = efsInternal("fTank", iBars, close());
bInit = true;
}
And
PHP Code:
// ROCKET FUNCTION
function fRocket(length, price) {
var MyVal = 0;
var MyBar = 0;
var n;
var fStop = length + 1 ;
if( fStop > 1 && fStop < 20 ) {
for(n=1;n<fStop;n++) {
var x = price.getValue(0) - price.getValue(-n) ;
if( x > MyVal) {
MyVal = x ;
MyBar = n ;
}
}
}
return new Array( getSeries(MyVal), getSeries(MyBar) ) ;
}
Thanking You In Advance.
P.S. what this will do is alert me when an instrument rises a threshold amount within a certain number of bars.
Comment