Hi, I'm declaring an array with a global scope, filling with data from end to the beginning ie using the absolute value of the value returned from the function getCurrentBarIndex().....
I can't seem to access the data...
Here's a sample:
var vArrayglobal = new Array (cArrywidth , cArrysze );
function preMain() {
}
function main() {
nIndex = getCurrentBarIndex();
var nAbsIndex = Math.abs(nIndex);
const cOffset1 = 1;
// avoid the 1st and 2nd items since they don't provide data
var nMaxIndex = getNumBars() - 3;
vArrayglobal[nAbsIndex] = [high(), low(), close()];
//if we are the beginning then can't get any items before it
if( nAbsIndex - cOffset1 <= nMaxIndex )
{
// doesn't work here
vArrayglobal[nAbsIndex][3] =
vArrayglobal[nAbsIndex+cOffset1][0];
//should of been able to get the previous item
}
}
any help would be kindly appreciated....
thanks
I can't seem to access the data...
Here's a sample:
var vArrayglobal = new Array (cArrywidth , cArrysze );
function preMain() {
}
function main() {
nIndex = getCurrentBarIndex();
var nAbsIndex = Math.abs(nIndex);
const cOffset1 = 1;
// avoid the 1st and 2nd items since they don't provide data
var nMaxIndex = getNumBars() - 3;
vArrayglobal[nAbsIndex] = [high(), low(), close()];
//if we are the beginning then can't get any items before it
if( nAbsIndex - cOffset1 <= nMaxIndex )
{
// doesn't work here
vArrayglobal[nAbsIndex][3] =
vArrayglobal[nAbsIndex+cOffset1][0];
//should of been able to get the previous item
}
}
any help would be kindly appreciated....
thanks
Comment