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();
}
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();
}
Comment