Hi~
I am trying to implement getFirstBarIndexOfDay as in the example below, but it does not seem to return the high of the first bar of the current day. Does anyone know what is wrong with this?
Thanks,
anarco
function main() {
var nState = getBarState();
var nIndex = getCurrentBarIndex();
var nBarIndex;
var nTime;
var nPrice;
var aHigh;
//if (nState == BARSTATE_CURRENTBAR){
if (nState == BARSTATE_NEWBAR){
var t1 = volume(0);
var t1_o = open(0);
nTime = getValue("rawtime", nIndex);
debugPrintln(nTime);
nBarIndex = getFirstBarIndexOfDay( nTime );
debugPrintln(nBarIndex);
aHigh =high(nBarIndex);
debugPrintln(aHigh);
}
I am trying to implement getFirstBarIndexOfDay as in the example below, but it does not seem to return the high of the first bar of the current day. Does anyone know what is wrong with this?
Thanks,
anarco
function main() {
var nState = getBarState();
var nIndex = getCurrentBarIndex();
var nBarIndex;
var nTime;
var nPrice;
var aHigh;
//if (nState == BARSTATE_CURRENTBAR){
if (nState == BARSTATE_NEWBAR){
var t1 = volume(0);
var t1_o = open(0);
nTime = getValue("rawtime", nIndex);
debugPrintln(nTime);
nBarIndex = getFirstBarIndexOfDay( nTime );
debugPrintln(nBarIndex);
aHigh =high(nBarIndex);
debugPrintln(aHigh);
}
Comment