Announcement

Collapse
No announcement yet.

Different EFS results LIVEDATA vs BULKDATALOAD

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

  • Different EFS results LIVEDATA vs BULKDATALOAD

    I am having challenges with EFS loading whereby – the data of a BULKLOAD (that is, when past data is being loaded via eSignal) is giving us different results than LIVELOAD (that is when live real-time data is going into the EFS).

    This is a serious problem for us until we get the answer.

    So our main question is what is causing different results when bar data is loaded versus live or tick data EFS runs. I believe there are two parts to this questions, as delineated below.

    That is, there are several issues here.

    1. No one seems to know the use of BARSTATE_ALLBARS. What does it mean the “bars are being loaded”? Does it mean the values in the arrarys are not yet filled? Does it mean that the OCHL for those pulses are not valid?
    2. If we are only interested in the data values of a bar (that is the Open, Close, High and Low whether we are doing BULKLOAD or LIVELOAD, what are the values that we need to pay attention to in order to get this data. If we issue ourEFSOpen = Open(), ourEFSClose = …. Etc. ---- then, when a pulse comes in on BARSTATE = NEWBAR, we know that that pulse is the first pulse of a newbar and the OCHL values in that pulse are all equal to the same value and that value is the OPEN value of this new bar, AND we know that the values we have stored for the last bar formed are complete for the OCHL and that the CHL for that bar can no longer change. But, this information does not seem to help us as the first pulse data coming in on the NEWBAR DO NOT SEEM TO MATCH OR WORK THE SAME WHEN WE ARE DOING A BULKLOAD VS A LIVE LOAD.

    We understand that when we get bar data, there can be three types:

    Pulse data = OCHL values for that point in time.

    BarClose data = OCHL values at the close of a bar. And, we only know it is BarClose data because a NEWBAR follows a BarClose bar.

    And, a NewBar bar has the same values for OCHL.

    But this information does not seem to help us get the same data BULKLOAD vs LIVE LOAD.

    Please help!

    I have reproduced the eSignal getBarState() function below so whoever answers can speak to us in a common language. And, below that, a portion of and EFS that displays this data.

    Please feel free to call me:

    MAIN NUMBER 718 462 1558 - Pierce

    CELL PHONE IF I AM NOT ON MY DESK (I work on this stuff 24x7) so do not be bashful to call at anytime: 917 207 8079





    getBarState()

    getBarState()

    Returns a status flag from the Formula Engine indicating the bar processing that is currently taking place.

    One of 3 flags can be returned:

    BARSTATE_ALLBARS
    BARSTATE_NEWBAR
    BARSTATE_CURRENTBAR

    Examples:

    nState = getBarState();

    if (nState == BARSTATE_ALLBARS) {

    //the bars are being loaded by the script. This happens when a script is first loaded
    debugPrint("Script is loading\n");
    }
    else if (nState == BARSTATE_NEWBAR) {
    //this flag is set when a new bar is coming in
    debugPrint("The first tick of a new bar has arrived\n");
    }
    else if (nState == BARSTATE_CURRENTBAR) {
    //this flag is set as each new tick comes in
    debugPrint("A new tick has arrived\n");
    }

    Some typical usages would be to use the BARSTATE_ALLBARS flag to initialize some data when the script first loads:

    if (getBarState() == BARSTATE_ALLBARS) {
    sSymbol = getSymbol(); //grab the name of the symbol being charted for later use
    nInterval = getInterval(); //grab the bar interval we are using for later use
    return;
    }

    or to cycle an array when a new bars comes in....

    if (getBarState() == BARSTATE_NEWBAR) {
    myArray.unshift(0);
    myArray.pop();
    }
    Attached Files

  • #2
    potye2,

    I am having challenges with EFS loading whereby – the data of a BULKLOAD (that is, when past data is being loaded via eSignal) is giving us different results than LIVELOAD (that is when live real-time data is going into the EFS).
    In most cases this shouldn't be, with the exception that historical data (I think this is what you call BULKLOAD) will not be created by individual ticks, but instead the EFS will read one bar of historical data as one tick with the OHLC and V information for the entire bar. So when loading historical bars NEWBAR will be called only once per bar. Perhaps this is what you are seeing?

    If you are having some other problem, can you give us an idea of how you are using it?
    Things like: 1) Symbol and Interval
    2) Time template applied (and what time zone you are in)
    3) What your EFS is doing that is showing different results

    One suggestion, if you haven't tried it yet it to write a simple script that will print out OHLC values and the state of the bar for each tick that comes in. This should give you an idea of how eSignal handles historical data and live data.


    . No one seems to know the use of BARSTATE_ALLBARS. What does it mean the “bars are being loaded”? Does it mean the values in the arrarys are not yet filled?
    This confuses me. If you are talking about an EFS array - they may ore may not be filled depending on how you created them. You (the EFS creator) are in control of what happens to an EFS array. All that ALLBARS means is that the chart is either being loaded for the first time, and this is the first tick OR that the chart is being reloaded for some reason, and this is the first tick of the reload. If you search this site you should see a few threads about this.

    2. If we are only interested in the data values of a bar (that is the Open, Close, High and Low whether we are doing BULKLOAD or LIVELOAD, what are the values that we need to pay attention to in order to get this data.
    You use open(), close(), etc to get the respective bar values. To determine if you are loading historical data vs. the most recent bar you can look at the bar index (getCurrentBarIndex()). Bar 0 is always the most recent bar and you subtract 1 for each bar pervios to that (so 0 is the most recent bar, -1 is the bar before that, -2 the bar before that, etc).


    All the above assumes you are not using setComputeOnClose(), which will give you different results for some of these items.

    Garth
    Garth

    Comment

    Working...
    X