指定
Expert Advisor(EA) by reading alerts or expert tab log (in real time) ,
if have Buy signal open buy trade,Waiting for the next signal(sell signal), closing the (buy) trade , opening a new trade(sell) ,
can be set lot sl tp commit!
commit type sample: pf-hour-tp-sl , pf-11-200-200
ea demand
1. (If it is too difficult, skip it first) To judge the big trend, judge the big trend through m30 or h1, and only make orders with the same trend, such as: XAUUSD M30 H1 BUY SIGINL, hang m5 or m15 ea, only buy , Do not sell
2, M5, M15, hang ea separately, trade separately, different magic hands,
3. Set a parameter, (all trading, only buying, only selling)
4. Parameters: tp, sl
5. Remarks: pf-the hour of the platform time (two digits: 01-23) (not the local time)-tp-sl, for example: pf-11-100-200 (11 o'clock, tp 100 sl 200)
6. Magic Hand: 8 + the hour of the platform time (two digits: 01-23) (not the local time) + m15 or m5 (15,05), for example: 81115 (eleven o'clock m15), 80105 (one point m5) ,
7. (If it is too difficult, skip it first) Order interval parameters: tp, sl interval (100), start point (0), end point (1000), so if the end point is 1000 and the interval is 100, the order will be placed 11*11=121 Times, and so on, arithmetic sequence.
here is code can refresh log in real time,mql4\logs files
https://www.mql5.com/en/forum/71130
#include <WinUser32.mqh> #import "user32.dll" int GetAncestor(int hWnd, int gaFlags); #import //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ void start() { int hwnd = GetAncestor(WindowHandle(Symbol(),Period()),2); // find the Terminal handle no. PostMessageW(hwnd,WM_COMMAND ,35435,0); // open the folder contains the log files //----- while (FindIfDirOpened() == 0) // check if the folder opened { Sleep(100); FindIfDirOpened(); } PostMessageW(FindIfDirOpened(), WM_CLOSE, 0, 0); //close the folder } int FindIfDirOpened() { string log = "logs"; string i; int handle = FindWindowW(i ,log); return(handle); }
tg:@hank789123
![](https://c.mql5.com/21/344/grzp_20211019123854__2.png)