[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 645

 

I have questions about the MQL4 tester. All actions have to be done by code(=programmatically).

1.What is the way to press the "Start" button to start the tester.

2..What is the way to press the "Stop" button to stop the tester(=can close the tester window).

If you suggest:

PostMessageA(WindowHandle(Symbol(),Period()), WM_COMMAND, 33050, 0);

I have <WindowHandle> in my tester doesn't work.

Maybe you can help?

 
Hello! I see a lot of people are trading on gold in the competitions. But how would I test an EA on gold? There is no such tool in the strategy tester on MT4! Or maybe I do not know how to activate it. Please, tell me how to activate it!
 
ikatsko:
Hello! I see that a lot of people are trading on gold in contests. But how would I test an Expert Advisor on gold? There is no such tool in strategy tester on MT4! Or maybe I do not know how to activate it. Please, advise!


Right-click on the content of the "Market Watch" tab in the terminal and select "Show all symbols".

Then in the strategy tester, choose gold (spot) or XAUUSD - the name depends on the brokerage company.

Then use F2 to download quotes and go...

 
Thank you! But I think this would be the way to select a tool for a demo account, for example. And I am asking about the possibility to select a tool in the strategy tester!!! In the "Symbol" field of the strategy tester!
 
ikatsko:
Thank you! But I think this would be the way to select a tool, for example, to work on a demo account. And I'm asking about the possibility to select an instrument in the strategy tester!!! In the "Symbol" field of the strategy tester!


I am showing it to you in the tester anyway (see 2nd screenshot) and how to select in the tester - this is what I have and the "Symbol" field of the strategy tester is open. Try it and that's it.

Without selecting "show all symbols" - you will not have gold in the tester for testing.

 

Yes, you're right. It turned out that on one of the terminals I work on, XAUUSD does not appear in the strategy tester tools. But it appears on another one! Your recommendation is correct. But not all brokerage companies support it. FreshForex, in particular, does not show gold in the Strategy Tester. Thank you

 
Qwertee: OK, another point in my EA is this branching:

if(period=="M15")
{
//check to open buy
Alert(buysell);

if(buysell=="buy")

Alert(1);

.............

}

Basically, nested if. BUT. condition if(period=="M15") is fulfilled and Alert gives a result, and buy, but condition if(buysell=="buy") is not fulfilled and Alert(1) command is not even executed. Damn, but both conditions are even syntactically the same, but why one is executed and the other is not?

Technically it's simple: buysell !="buy" - so the next Alert(1) is not executed.

What does buysel variable contain at that moment is found out by print: Print (buysell); after first Alert.

 
Good afternoon, I made a bot to signal if the conditions are the same.
extern string SoundFile = Паровоз.wav.....

..............

if a >  b && b > c && c > d......
 {
  Alert("SELL  -> NZD_INDEX");
  PlaySound(SoundFile);
  Sleep(100000);
 }   



Please advise what I did wrong, the window appears but does not beep as it should and sounds the default alert from the terminal.
 
odiseif: Please tell me what I did wrong, the window pops up but the default Alert sound from the terminal does not sound as it should.

and if you run the script with just one line:

int start(){
   PlaySound("Паровоз.wav");
return(0);
}

Does it work? If not, then the steam locomotive.wav sound probably doesn't reside in the folder: terminal_directory\sounds

sound from terminal can be disabled in menu: service-settings-events tab, click on the bell to show cross

 
IgorM:

and if you run the script with just one line:

Does it work? If it doesn't, then the steam engine.wav sound probably doesn't reside in the folder: terminal_directory\sounds

sound from the terminal can be disabled in the menu: service-settings-events tab, click on the bell there to get a cross


Thanks ... about the piece of code do not understand how to solve this problem yet .... am an amateur however .... redo the simple under my conditions .... but the cross will try, maybe get it. the most interesting thing is that the bot I made the signal occurred on 4 time zones ...... So when the signal on the m1 for one index, it is the default alerts, and when the conditions arise for m5 it alerts as I need .... and prescribed the same way everywhere . as for m1 and for m5, m15 and n1
Reason: