โหลดจาก
https://www.mql5.com/en/code/8175ผมต้องแก้อย่างไรบ้างครับ
//+------------------------------------------------------------------+
//| shablon.mq4 |
//| Viatcheslav Suvorov |
//+------------------------------------------------------------------+
#property copyright "Viatcheslav Suvorov"
#property show_inputs
#include <WinUser32.mqh>
#import "mt4excel.dll"
bool ExcelOpen();//ฮ๒๊๐๛โเๅ๒ Excel ่ ๑๎็ไเๅ๒ ๗่๑๒๓ ๑๒๐เํ่๖๓
bool ExcelClose();//วเ๊๐๛โเๅ๒ Excel
bool ExcelOpenPattern(int NumPatt);//ฮ๒๊๐๛โเๅ๒ Excel ๏๎ ๘เแ๋๎ํ๓
bool ExcelOpenFile(string FileName);//ฮ๒๊๐๛โเๅ๒ ๔เ้๋ Excel
bool ExcelSave();//ั๎๕๐เํๅ์ ๔เ้๋
bool ExcelSaveAs(string FileName);//ั๎๕๐เํๅ์ ๔เ้๋ โ FileName
bool ExcelAddSheet(string Name);//ฤ๎แเ่๒ ๋่๑๒ ่ ๑ไๅ๋เ๒ ๅใ๎ เ๊๒่โํ๛์
bool ExcelSetFormulaCell(int X,int Y,string Value);//วเ๏่๑เ๒ ๔๎๐์๓๋๓ โ ๗ๅ้๊๓
double ExcelGetValueCell(int X,int Y);//ั๗่๒เ๒ ๗่๑๋๎ ่็ ๗ๅ้๊่
string ExcelGetTextCell(int X,int Y);//ั๗่๒เ๒ ๒ๅ๊๑๒ ่็ ๗ๅ้๊่
string ExcelGetFormulaCell(int X,int Y);//ั๗่๒เ๒ ๔๎๐์๓๋๓ ่็ ๗ๅ้๊่
/*TypeD - ๒่๏ ไ่เใ๐เ์์๛:
xl3DArea -4098 xl3DAreaStacked 78 xl3DAreaStacked100 79 xl3DBarClustered 60 xl3DBarStacked 61 xl3DBarStacked100 62
xl3DColumn -4100 xl3DColumnClustered 54 xl3DColumnStacked 55 xl3DColumnStacked100 56 xl3DLine -4101 xl3DPie -4102
xl3DPieExploded 70 xlArea 1 xlAreaStacked 76 xlAreaStacked100 77 xlBarClustered 57 xlBarOfPie 71
xlBarStacked 58 xlBarStacked100 59 xlBubble 15 xlBubble3DEffect 87 xlColumnClustered 51 xlColumnStacked 52
xlColumnStacked100 53 xlConeBarClustered 102 xlConeBarStacked 103 xlConeBarStacked100 104 xlConeCol 105 xlConeColClustered 99
xlConeColStacked 100 xlConeColStacked100 101 xlCylinderBarClustered 95 xlCylinderBarStacked 96 xlCylinderBarStacked100 97 xlCylinderCol 98
xlCylinderColClustered 92 xlCylinderColStacked 93 xlCylinderColStacked100 94 xlDoughnut -4120 xlDoughnutExploded 80 xlLine 4 xlLineMarkers 65
xlLineMarkersStacked 66 xlLineMarkersStacked100 67 xlLineStacked 63 xlLineStacked100 64 xlPie 5 xlPieExploded 69 xlPieOfPie 68 xlPyramidBarClustered 109
xlPyramidBarStacked 110 xlPyramidBarStacked100 111 xlPyramidCol 112 xlPyramidColClustered 106 xlPyramidColStacked 107 xlPyramidColStacked100 108
xlRadar -4151 xlRadarFilled 82 xlRadarMarkers 81 xlStockHLC 88 xlStockOHLC 89 xlStockVHLC 90 xlStockVOHLC 91 xlSurface 83
xlSurfaceTopView 85 xlSurfaceTopViewWireframe 86 xlSurfaceWireframe 84 xlXYScatter -4169 xlXYScatterLines 74 xlXYScatterLinesNoMarkers 75
xlXYScatterSmooth 72 xlXYScatterSmoothNoMarkers 73 */
bool ExcelSetDiagramma(int TypeD,string Title,string XRange,string YRange,int Left,int Top,int Riht,int Bottom);//ฤ๎แเโ๋ๅ๒ ไ่เใ๐เ์๓
bool ExcelDiagrammaAddRange();//ฤ๎แเโ่๒ ไเํํ๛๕ โ ไ่เใ๐เ์์๓. ฯๅ๐โเ ๑๒๐๎๊เ - ็เใ๎๋๎โ๎๊
bool ExcelSetValueCell(int X,int Y,double Value);//วเ๏่๑เ๒ ๗่๑๋๎ โ ๗ๅ้๊๓
bool ExcelSetTextCell(int X,int Y,string Value);//วเ๏่๑เ๒ ๒ๅ๊๑๒ โ ๗ๅ้๊๓
bool ExcelSetRange(string Range);//วเ๏๎์ํ่๒ ไ่เ๏เ็๎ํ
string ExcelGetFormat();//ย๎็โ๐เ๙เๅ๒ ๔๎๐์เ๒ ไ่เ๏เ็๎ํเ
bool ExcelSetFormat(string Format);//วเไเ๒ ๔๎๐์เ๒ ไ๋ ไ่เ๏๎็เํเ
bool ExcelSetFormula(string Formula);//วเ๏่๑เ๒ ๔๎๐์๓๋๓ โ ไ่เ๏เ็๎ํ
bool ExcelIsFormula();//true ๅ๑๋่ โ ไ่เ๏เ็๎ํๅ ๔๎๐์๓๋เ
int ExcelRangeCount();//ส๎๋-โ๎ ๗ๅๅ๊ โ ไ่เ๏เ็๎ํๅ
string ExcelRangeAdress();//ภไ๐ๅ๑๑ ไ่เ๏เ็๎ํเ
bool ExcelRangeColumnWidth(int Width);//ุ่๐่ํเ ไ่เ๏เ็๎ํเ
bool ExcelRangeRowHeight(int Height);//ย๛๑๎๒เ ไ่เ๏เ็๎ํเ
bool ExcelRangeInteriorColor(int Color);//ึโๅ๒ ๔๎ํเ ไ่เ๏เ็๎ํเ
bool ExcelRangeFontColor(int Color);//ึโๅ๒ ๘๐่๔๒เ ไ่เ๏เ็๎ํเ
int ExcelGetLastErrorCode();//ส๎ไ ๏๎๑๋ๅไํๅ้ ๎๘่แ๊่ Excel
string ExcelGetLastErrorText();//าๅ๊๑๒ ๏๎๑๋ๅไํๅ้ ๎๘่แ๊่ Excel
#import
int start()
{
if (ExcelOpen()) Print("ำc๏ๅ๘ํ๎ ๎๒๊๐๛๋่ Excel"); else Print("อๅ ๎๒๊๐๛โเๅ๒๑ Excel:",ExcelGetLastErrorText());//ฮ๒๊๐๛โเๅ์ Excel
ExcelSetTextCell(1,1,"ศํ๑๒๐๓์ๅํ๒");
ExcelSetTextCell(2,1,"EURUSD");
ExcelSetTextCell(3,1,"GBPUSD");
ExcelSetTextCell(4,1,"USDCHF");
ExcelSetTextCell(1,2,"ฮ๒๊๐๛๒่ๅ(0:0 GMT)");
ExcelSetValueCell(2,2,iOpen("EURUSD",PERIOD_D1,0));
ExcelSetValueCell(3,2,iOpen("GBPUSD",PERIOD_D1,0));
ExcelSetValueCell(4,2,iOpen("USDCHF",PERIOD_D1,0));
ExcelSetTextCell(1,3,"ฯ๎๑๋ๅไํ่้ Bid");
ExcelSetValueCell(2,3,MarketInfo("EURUSD",MODE_BID));
ExcelSetValueCell(3,3,MarketInfo("GBPUSD",MODE_BID));
ExcelSetValueCell(4,3,MarketInfo("USDCHF",MODE_BID));
ExcelSetTextCell(1,4,"ศ็์ๅํๅํ่ๅ ็เ ไๅํ");
ExcelSetRange("D2:D4");
ExcelSetFormula("=C2-B2");
ExcelSetRange("A1");
ExcelRangeColumnWidth(15);
ExcelSetRange("B1");
ExcelRangeColumnWidth(20);
ExcelSetRange("C1");
ExcelRangeColumnWidth(20);
ExcelSetRange("D1");
ExcelRangeColumnWidth(20);
ExcelSetRange("A1:D1");
ExcelRangeInteriorColor(0x000000);
ExcelRangeFontColor(0xFFFFFF);
ExcelSetDiagramma(103,"ศ็์ๅํๅํ่ๅ ็เ ไๅํ","A2:A4","D1:D4",1,50,400,200);
bool NeedLoop=true;
double lastEURUSD,lastGBPUSD,lastUSDCHF;
double curEURUSD,curGBPUSD,curUSDCHF;
while(NeedLoop){
curEURUSD=MarketInfo("EURUSD",MODE_BID);
curGBPUSD=MarketInfo("GBPUSD",MODE_BID);
curUSDCHF=MarketInfo("USDCHF",MODE_BID);
if (lastEURUSD!=curEURUSD){
lastEURUSD=curEURUSD;
ExcelSetValueCell(2,3,MarketInfo("EURUSD",MODE_BID));
}
if (lastGBPUSD!=curGBPUSD){
lastGBPUSD=curGBPUSD;
ExcelSetValueCell(3,3,MarketInfo("GBPUSD",MODE_BID));
}
if (lastUSDCHF!=curUSDCHF){
lastUSDCHF=curUSDCHF;
ExcelSetValueCell(4,3,MarketInfo("USDCHF",MODE_BID));
}
Sleep(1000);
}//while
return(0);
}
void deinit()
{
ExcelSaveAs("C:\proba.xls");
ExcelClose();
}
มันขึ้น error ว่า p
'p' - unrecognized character escape sequence