Complex programming like dashboard with button? No need auto trading. Just for monitoring and alert.
I'll pm u @yousername.
I'll pm u @yousername.
What is the best way to get started learning MQL4 programming language? 22 replies
Free mql4 programming 65 replies
MQL4 programming help needed - simply combining indicators 0 replies
MQL4 Language Most Recent Version is it updated beyond the tutorial on the mql4 websi 6 replies
DislikedHello, can I ask a question here? It has been confused me for a long time. Thank you! When doing back test in Visual mode, instead of automatically proceeding, we can manually show the bar one by one by pressing F12 key. What I want to do is that by pressing one key, for example S key (the key code is 0x53), then F12 will be sent to MT4 five times. The code is as below. The result is, when in back test, pressing S key will show bars just as F12 was entered, however, only one, or two, at most three bars come out every time! I wonder why it does not...Ignored
DislikedHello, can I ask a question here? It has been confused me for a long time. Thank you! When doing back test in Visual mode, instead of automatically proceeding, we can manually show the bar one by one by pressing F12 key. What I want to do is that by pressing one key, for example S key (the key code is 0x53), then F12 will be sent to MT4 five times. The code is as below. The result is, when in back test, pressing S key will show bars just as F12 was entered, however, only one, or two, at most three bars come out every time! I wonder why it does not...Ignored
#import "user32.dll"
void keybd_event(int bVk, int bScan, int dwFlags,int dwExtraInfo);
int SendInput(int nInputs,int pInputs,int cbSize);
string GetLastError();
#import
#define KEYEVENTF_KEYUP 0x0002 //--- key is released (not pressed)
void OnChartEvent(const int id, // Event identifier
const long& lparam, // Event parameter of long type
const double& dparam, // Event parameter of double type
const string& sparam) // Event parameter of string type
{
if (id == CHARTEVENT_KEYDOWN)
{
switch(int(lparam))
{
case 0x53: // 'S'
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP , 0);
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP , 0);
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP , 0);
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP , 0);
keybd_event(0x41, 0, 0, 0);
keybd_event(0x41, 0, KEYEVENTF_KEYUP , 0);
break;
case 0x08://Backspace
Alert("Delete");
break;
case 0x41://'a'
Print("A");
break;
}
}
} DislikedThanks for your quick reply! >What does F12 do on the MT4? When doing back test manually, F12 moves the chart forward by 1 candlestick at a time. The url below describes this. https://www.fxdayjob.com/manual-backtesting-in-mt4 >With the code above when you click S it will call click A and print A 5x However, this does not apply to F12. As I wrote yesterday, pressing S key will show only one , or two bars, at most three bars come out at a time, not 5x! Maybe this is the bug of MT4 back test?? {image}Ignored
DislikedI tried your code and found on back test "A" was printed for five times. So I guess Backtest window does receive F12 5x but can not deal with for some reason. I will new a thread to ask other guys if there is workaround. Thank you so much for your time and advice!Ignored
Disliked{quote} ... and do not know what decompile means. And why this wold be a problem.Ignored
Disliked{quote} That simply means that it isn't the original source code. It is a illegally pirated/decompiled code. No serious coders work with that kind of file ... Please don't get me wrong ... No disrespect intented here. You are not the culprit!Ignored
Disliked{quote} Indicator doesnt look pirated and it is also free for download http://www.best-metatrader-indicator...eba-indicator/Ignored
Disliked{quote} That simply means that it isn't the original source code. It is a illegally pirated/decompiled code. No serious coders work with that kind of file ... Please don't get me wrong ... No disrespect intented here. You are not the culprit!Ignored