Announcement

Collapse
No announcement yet.

getBarState() Bug on Tick data?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getBarState() Bug on Tick data?

    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.
    Attached Files

  • #2
    Hello silverdad,

    I've confirmed your findings with getBarState() on a raw tick interval and will report this to our development team.

    On a side note, I'm curious to know why you need to use getBarState() with a raw tick interval. Is there a particular routine that you are having trouble with on a raw tick interval? Give me some more details and maybe I can help find an alternative solution for you.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X