/////////////////////////////////////////////////////////////////////////// // SnapshotSymbolIndy.mq4 // Mark Chaudhary // // Creates a screen shot when a trade is opened or closed for the symbol // on the chart. GIFs are placed in experts/files/ subdirectory of your // MetaTrader instalation. // ////////////////////////////////////////////////////////////////////////// #property copyright "Mark Chaudhary" #property link "" ///////////////////////////////////////////// #property indicator_chart_window bool tradeFlag=false; bool prevTradeFlag=false; static datetime last_bar; int init() { return(0); } int deinit() { return(0); } int start(){ int orders=0; for (int i=0; i0) tradeFlag=true; else tradeFlag=false; if (tradeFlag != prevTradeFlag){ prevTradeFlag=tradeFlag; MakeScreenShot(); } return(0); } void MakeScreenShot(){ static int no=0; no++; string fn = "SnapShot"+Symbol()+Period()+"\\"+Year()+"-"+al0(Month(),2)+"-"+al0(Day(),2)+" "+ al0(Hour(),2)+"_"+al0(Minute(),2)+"_"+al0(Seconds(),2)+" "+no+".gif"; if(!ScreenShot(fn,640,480)) Print("ScreenShot error: ", GetLastError()); } string al0(int number, int digits){ // add leading zeros that the resulting string has 'digits' length. string result; result = DoubleToStr(number, 0); while(StringLen(result)