//+------------------------------------------------------------------+ //| HomeKeyRpeater.mq4 | //| Copyright (c) 2009, fai. | //| http://d.hatena.ne.jp/fai_fx/ | //+------------------------------------------------------------------+ #property copyright "Copyright (c) 2009, fai" #property link "http://d.hatena.ne.jp/fai_fx/" #property show_confirm #include int start() { if (!IsDllsAllowed()) { Alert("ERROR: [Allow DLL imports] NOT Checked.");return (0); } int i = 0; int hwnd = WindowHandle(Symbol(), Period()); while (!IsStopped()) { PostMessageA(hwnd, WM_KEYDOWN, 36, 0);//36=Home PostMessageA(hwnd, WM_KEYUP, 36, 0); Sleep(1000); Comment(" Bars = ", WindowFirstVisibleBar()," Home Key Count = ", i); i++; WindowRedraw(); } return (0); }