getBarState() seems to return incorrect results on high volume tick data. Run the following script on "EUR A0-FX,T"
var vSymbol;
function preMain() {
setPriceStudy(true);
vSymbol = getSymbol() + "," + getInterval();
debugPrint( "preMain called Symbol = " + vSymbol + "\n" );
}
function main()
{
if( getCurrentBarIndex() < 0 )
{
if( getCurrentBarIndex() <= getOldestBarIndex() )
debugPrint( "Initialize Data Symbol = " + vSymbol + " Oldest Index = " + getOldestBarIndex() + "\n" );
}
else
{
debugPrint( "main called Symbol = " + vSymbol + " BarState = " + getBarState() + " NumBars = " + getNumBars() + " Index = " + getCurrentBarIndex() + " Oldest Index = " + getOldestBarIndex() + " Close: " + getValue("Close", -1, 1 ) + " " + getValueAbsolute("Close", -1, 1) + "\n" );
}
}
function postMain()
{
debugPrint( "postMain called Symbol = " + vSymbol + "\n" );
}
getBarState() will return 0 or 1 (at random?) even though the number of bars always increases.
var vSymbol;
function preMain() {
setPriceStudy(true);
vSymbol = getSymbol() + "," + getInterval();
debugPrint( "preMain called Symbol = " + vSymbol + "\n" );
}
function main()
{
if( getCurrentBarIndex() < 0 )
{
if( getCurrentBarIndex() <= getOldestBarIndex() )
debugPrint( "Initialize Data Symbol = " + vSymbol + " Oldest Index = " + getOldestBarIndex() + "\n" );
}
else
{
debugPrint( "main called Symbol = " + vSymbol + " BarState = " + getBarState() + " NumBars = " + getNumBars() + " Index = " + getCurrentBarIndex() + " Oldest Index = " + getOldestBarIndex() + " Close: " + getValue("Close", -1, 1 ) + " " + getValueAbsolute("Close", -1, 1) + "\n" );
}
}
function postMain()
{
debugPrint( "postMain called Symbol = " + vSymbol + "\n" );
}
getBarState() will return 0 or 1 (at random?) even though the number of bars always increases.
Comment