Questions from Beginners MQL5 MT5 MetaTrader 5 - page 200
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
When debugging, the EA crashes, although in theory it should cycle in OnTIck until the Tik==0 condition becomes false.
When debugging, the Expert Advisor crashes, although in idea it must execute a loop in OnTIck until the condition Tik==0 becomes false.
Look for errors. When compiling, pay attention to the error message.
says that you are trying to create a variable and the variable already exists in global declarations.
And so on and so forth.
Hello! I mastered MQL4 a year ago with ease. Now I'm trying to translate my EAs in MQL5, but I cannot even grasp the basics of the new language. If you can, please send me a simple program for opening a position at crossing a fast and a slow moving indicator with setting of Stop and Profit. Here is an example of a program that works in MQL4:
#define Lot 0.1
extern int Magic = 105;
extern int St=70;
extern int Pr=50;
static int prevtime = 0;
extern int PerF=15;
extern int PerL=55;
int init() { return(0); } int deinit() { return(0); }
int start() {
if (Time[0] == prevtime) return(0);
prevtime = Time[0];
if( iMA(NULL,0,PerF,0,MODE_SMMA,PRICE_MEDIAN,1)>iMA(NULL,0,PerL,0,MODE_SMMA,PRICE_MEDIAN,1)
&& iMA(NULL,0,PerF,0,MODE_SMMA,PRICE_MEDIAN,2)<iMA(NULL,0,PerL,0,MODE_SMMA,PRICE_MEDIAN,2) )
{ OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-St*Point,Ask+Pr*Point, "2014",Magic,0,Green);}
return(0); }
Install Internet Explorer version 8 or higher, even if you never use it. Did the developers tie the Market in the terminal to this browser for some reason?
There are various scalper EAs in the Market that show amazing results in the tester. But will they work on a real account?
This can only be tested on a real account if a free version of the EA is available. Many sellers put up Free versions of their paid EAs, so they can be tested not only in the tester.
But it is advisable, before testing on the real account, to make sure that we are not dealing with the tester grail on the demo accounts. Otherwise you will have no luck.
StrangerNet:
Count the brackets to see if they are paired. I have counted more open than closed.
The further condition is simple, it duplicates what I wrote for the Sell order type.
The question still remains. Why does not it go further than the first condition?
The condition is simple there, it duplicates what I wrote for Sell order type.
The question remains! Why doesn't it go further than the first condition?
Either attach the whole code or initialize your variables before the code snippet, please. I don't know what you have in your variables, for example in