Regardless of the interval selected for a chart, I would like to load the array below with all of the ticks in the last bar. I was using xInterval=1 and getValue("close",0,getInterval(),xSymbol) to rely on 1-minute data, but want to switch to tick data. How do I determine how many ticks in a bar so that I can replace the -2 (for testing only) with the number of ticks? Thanks.
------------------------------
function main () {
if (getBarState == BARSTATE_ALLBARS) return;
var xInterval = "T";
var xSymbol = getSymbol()+","+xInterval;
pArray = getValue ("close", 0, -2, xSymbol);
return new Array (pArray[0], pArray[1]);
}
------------------------------
function main () {
if (getBarState == BARSTATE_ALLBARS) return;
var xInterval = "T";
var xSymbol = getSymbol()+","+xInterval;
pArray = getValue ("close", 0, -2, xSymbol);
return new Array (pArray[0], pArray[1]);
}
Comment