Function for screenshot taking in Metatrader 4
Recently I was looking for certain function for taking screenshots of charts in Metatrader.
Here is the sample:WindowScreenShot("TIMESTAMP_"+Month()+"_D"+Day()+"_H"+Hour()+"_M"+Minute()+"_S"+Seconds()+".gif",1024,768);
Here is the desctiption by Metatrade help library:
Saves current chart screen shot as a GIF file. Returns FALSE if it fails. To get the error code, one has to use the GetLastError() function. Parameters:
Sample:
int lasterror=0; //---- tester has closed one or more trades if(IsTesting() && ExtTradesCounter<TradesTotal()) { //---- make WindowScreenShot for further checking if(!WindowScreenShot("shotstester"+ExtShotsCounter+".gif",640,480)) lasterror=GetLastError(); else ExtShotsCounter++; ExtTradesCounter=TradesTotal(); } |
||||||||||||||||||||
Leave a Reply