I got a process that as to be done at the beginning of a bar
- Capture the last High, Low
- Capture the time: ending time end time[1] Starting time
These value are then transmit to my Excel sheet to be process and fire if needed an order.
Problem is BarStatus = 0 is once in a while not detected and data are not sent for this bar. It may occur while system is occupied with a voice message. I will turn of the voice, but is there other way to insure that all Barstatus = 0 is detected.
I did work with BarStatus[1] = 2, but doing so, I don't have the ending time of the actual starting bar
Martin
Code: Select all
if barstatus = 0 then begin
BarCompleted = "BC";
// Now, Format the time for the GAD & GTA
Datetimestring = FormatTime("HH:mm:ss", ELTimetodatetime_s(Time_s[1]));
EndDateTimeString = FormatTime("HH:mm:ss", ELTimetodatetime_s(Time_s));
//Format the date for the GAT & GTA
GAD_Str = Leftstr(Text(date[1] + 19000000),8); //good afterdate
GTD_Str = Leftstr(Text(date + 19000000),8); // good til date
GAD_STR = Gad_Str + spaces(1) + DateTimeString;
GTD_STR = GTD_Str + spaces(1) + EndDateTimeString;
//print (gad_Str, spaces(5), gtd_Str);
LastbarString = numtoStr(Open[1],5 )+ comma + NumtoStr(High[1],5) + comma + NumToStr(Low[1],5) + comma + NumToStr(Close[1],5)+ comma +
NumToStr(LSL1,5) + comma + NumtoStr(lsl2,5) + comma + NumToStr(lsh1,5) + comma + NumToStr(lsh2,5) + comma +
GAD_Str + comma + GTD_Str ;
Lastbarstring = lastbarstring + comma + exittimestring + comma + exitdatestring + Barcompleted;
//print ( "sbook ", Sbook," ", ssheet," ", lastbarstring);
xlo.Text(Sbook,sSheet,"LastBarString",LastBarString);
LastBardone = false;
print (time_S:0:0, " ", lastBarString);
end;