ขอบคุณมากครับ
string substr=StringSubstr(ls_96 , 0, 6); ผมแก้ 6 เป็น 7แล้วได้ชื่อ file ตามที่ต้องการแล้ว = nEURUSD1.hst
โปรแกรมเปิดได้แล้ว แต่เจอปัญหาใหม่ ข้อมูลไม่ยอม update ครับ
string ls_96 = "n" + Symbol();
string substr=StringSubstr(ls_96 , 0, 7);
int li_104 = Period() * gi_140;
int l_digits_108 = Digits;
l_file_0 = FileOpenHistory(substr + li_104 + ".hst", FILE_BIN|FILE_WRITE);
if (l_file_0 >= 0) {
ls_88 = "(C)opyright 2003, MetaQuotes Software Corp.";
FileWriteInteger(l_file_0, li_84, LONG_VALUE);
FileWriteString(l_file_0, ls_88, 64);
FileWriteString(l_file_0, ls_96, 12);
FileWriteInteger(l_file_0, li_104, LONG_VALUE);
FileWriteInteger(l_file_0, l_digits_108, LONG_VALUE);
FileWriteInteger(l_file_0, 0, LONG_VALUE);
FileWriteInteger(l_file_0, 0, LONG_VALUE);
FileWriteArray(l_file_0, lia_112, 0, 13);
li_24 = 60 * li_104;
li_8 = Bars - 1;
l_open_28 = Open[li_8];
l_low_36 = Low[li_8];
l_high_44 = High[li_8];
ld_60 = Volume[li_8];
li_12 = Time[li_8] / li_24;
li_12 *= li_24;
for (int li_4 = li_8 - 1; li_4 >= 0; li_4--) {
l_time_16 = Time[li_4];
if (li_4 == 0)
if (RefreshRates()) li_4 = iBarShift(NULL, 0, l_time_16);
if (l_time_16 >= li_12 + li_24 || li_4 == 0) {
if (li_4 == 0 && l_time_16 < li_12 + li_24) {
ld_60 += Volume[0];
if (Low[0] < l_low_36) l_low_36 = Low[0];
if (High[0] > l_high_44) l_high_44 = High[0];
l_close_52 = Close[0];
}
li_20 = FileTell(l_file_0);
l_volume_68 = Volume[li_4];
FileWriteInteger(l_file_0, li_12, LONG_VALUE);
FileWriteDouble(l_file_0, l_open_28, DOUBLE_VALUE);
FileWriteDouble(l_file_0, l_low_36, DOUBLE_VALUE);
FileWriteDouble(l_file_0, l_high_44, DOUBLE_VALUE);
FileWriteDouble(l_file_0, l_close_52, DOUBLE_VALUE);
FileWriteDouble(l_file_0, ld_60, DOUBLE_VALUE);
FileFlush(l_file_0);
l_count_80++;
if (l_time_16 >= li_12 + li_24) {
li_12 = l_time_16 / li_24;
li_12 *= li_24;
l_open_28 = Open[li_4];
l_low_36 = Low[li_4];
l_high_44 = High[li_4];
l_close_52 = Close[li_4];
ld_60 = l_volume_68;
}
} else {
ld_60 += Volume[li_4];
if (Low[li_4] < l_low_36) l_low_36 = Low[li_4];
if (High[li_4] > l_high_44) l_high_44 = High[li_4];
l_close_52 = Close[li_4];
}
}
FileFlush(l_file_0);
FileClose(l_file_0);
ผมลองแทนที่ ls_96 ด้วย substr ตรง
FileWriteString(l_file_0, ls_96, 12);
ก็ไม่ได้ครับ
รบกวนอีกหน่อยนะครับ