You have been of great asisstance. Notice how the the data to the right of the orange line is live data that has never been reset since the EFS was loade at 4:50am . But I had to reboot my computer at 4:45 am and lost all the live signals from 2 am to 4:45 am. But I am now able to replace them as they existed.
Per your suggestion I am trying to implement the reloading of saved live signal using the...
"if (getBarState == BARSTATE_ALLBARS) {
I assume the purpose here is to load the missed live data signals ONLY once, at EFS startup, and not at every bar all over again **after** startup.
For now, I am keeping this EFS as a seperate EFS and not part of my live trading EFS, to keep the live trading EFS as simple as possible. I also have includeded green bars to show the limits of the added live trading signals by searching through the data for the highest and lowest rawtime, and then incrementing these bar offsets by one for each new bar
However, I had to rem out the getBarState statement/if because when I used it, it did **not** draw the signals. Why not?
Also, I am trying to keep the green bars shown all the time, but I can not figure out why they disappear after the 2nd bar is loaded -- they stay on for just one bar's duration.
Here is complete EFS. How can I design this so the signals load just once and not at every bar. Then all the EFS has to do after that is keep the green bars visible and increment the bar offsets by one.
Data file
1141870980|SystemCheckMarkBlue|1.2015
1141871220|SystemHappyFace|1.2016
1141871700|SystemCheckMarkBlue|1.2008
1141871820|SystemReallyHappyFace|1.200500000000000 1
1141876740|SystemCheckMarkBlue|1.1999900000000001
1141876860|SystemReallyHappyFace|1.199890000000000 1
1141878780|SystemCheckMarkBlue|1.2008
1141878900|SystemHappyFace|1.2009
Per your suggestion I am trying to implement the reloading of saved live signal using the...
"if (getBarState == BARSTATE_ALLBARS) {
I assume the purpose here is to load the missed live data signals ONLY once, at EFS startup, and not at every bar all over again **after** startup.
For now, I am keeping this EFS as a seperate EFS and not part of my live trading EFS, to keep the live trading EFS as simple as possible. I also have includeded green bars to show the limits of the added live trading signals by searching through the data for the highest and lowest rawtime, and then incrementing these bar offsets by one for each new bar
However, I had to rem out the getBarState statement/if because when I used it, it did **not** draw the signals. Why not?
Also, I am trying to keep the green bars shown all the time, but I can not figure out why they disappear after the 2nd bar is loaded -- they stay on for just one bar's duration.
Here is complete EFS. How can I design this so the signals load just once and not at every bar. Then all the EFS has to do after that is keep the green bars visible and increment the bar offsets by one.
PHP Code:
/*************************************************************************************************
10:00 pm 09MAR06 LIVELOAD.efs
**************************************************************************************************
Last fix:
TODO:
*****************************************************************************************************/
var vVERSION = "1.0xx";
var f = new File("LIVELOAD.txt");
var sCurrentSignalData = null;
var sCurrentSignalDataArray = null;
var sCurrentSignalDataBAR = null;
var sCurrentSignalDataSYM = null;
var sCurrentSignalDataPRI = null;
var vMinBarRAW = 2222222222222;
var vMaxBarRAW = 0;
var vMinBarOffset = null;
var vMaxBarOffset = null;
var bOneFlag = false;
function preMain() {
setPriceStudy(true);
setShowCursorLabel(false);
setComputeOnClose();
setStudyTitle("Load Live Signals -- v" + vVERSION + " using LIVELOAD.txt");
// ************** GET EARLIEST/LASTEST BAR LOCATION -- DRAW GREEN LINES BELOW ******************** f.open("rt");
while(!f.eof()) {
sCurrentSignalData = f.readln();
if (sCurrentSignalData != null) {
sCurrentSignalDataArray = sCurrentSignalData.split("|");
sCurrentSignalDataBAR = sCurrentSignalDataArray[0];
if (sCurrentSignalDataBAR < vMinBarRAW) {
vMinBarRAW = sCurrentSignalDataBAR;
}
if (sCurrentSignalDataBAR > vMinBarRAW) {
vMaxBarRAW = sCurrentSignalDataBAR;
}
}
}
f.close();
} // end PREMAIN
function main() {
// if (getBarState == BARSTATE_ALLBARS) { // THIS DOES NOT WORK
f.open("rt");
while(!f.eof()) {
sCurrentSignalData = f.readln();
if (sCurrentSignalData != null) {
sCurrentSignalDataArray = sCurrentSignalData.split("|");
sCurrentSignalDataBAR = sCurrentSignalDataArray[0];
sCurrentSignalDataSYM = sCurrentSignalDataArray[1];
sCurrentSignalDataPRI = sCurrentSignalDataArray[2];
if ( rawtime(0) == sCurrentSignalDataBAR ) {
drawImageRelative(0, sCurrentSignalDataPRI, sCurrentSignalDataSYM, null, Image.RIGHT | Image.ONTOP, "CM" + rawtime(0));
}
}
}
f.close();
// }
if (rawtime(0) >= vMinBarRAW) {
vMinBarOffset = vMinBarOffset + 1
}
if (rawtime(0) >= vMaxBarRAW) {
vMaxBarOffset = vMaxBarOffset + 1
}
// if (getCurrentBarIndex() == 0) {
if (isLastBarOnChart()) {
addLineTool(LineTool.VERT, vMinBarOffset * -1, 5, Color.lime, "EARLYBAR");
addLineTool(LineTool.VERT, vMaxBarOffset * -1, 5, Color.lime, "LASTBAR");
}
// setStudyTitle("Load Live Signals -- v" + vVERSION + " using LIVELOAD.txt. Earliest bar is: " + vMinBarRAW + " ("+ vMinBarOffset*-1 + ") -- RAW = "+ rawtime(0));
}
1141870980|SystemCheckMarkBlue|1.2015
1141871220|SystemHappyFace|1.2016
1141871700|SystemCheckMarkBlue|1.2008
1141871820|SystemReallyHappyFace|1.200500000000000 1
1141876740|SystemCheckMarkBlue|1.1999900000000001
1141876860|SystemReallyHappyFace|1.199890000000000 1
1141878780|SystemCheckMarkBlue|1.2008
1141878900|SystemHappyFace|1.2009
Comment