Questions from Beginners MQL5 MT5 MetaTrader 5 - page 196
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
You create an indicator handle on each tick (i.e. in OnCalculate()). This is incorrect. The indicator handle should be created in OnInit(). On the M15 chart, you can use the data from D1. But in this case, the data may not be ready - read "Organizing data access" https://www.mql5.com/ru/docs/series/timeseries_access.
I am reading this link and I am very indignant, I can't think of anything but foul language. I'm just redesigning my indicator in 4 and it's just the beginning, not even much else, but already a hangup. I understand that the possibility for mql5 programming is great, but at what price. For me it's hard to say what was the optimization or upgrade of mql4 in mql5, in mql5 I haven't seen anything in real trading, it's just a picture gibberish. I don't know, maybe it's just emotions, I will see. All the same, thank you!
I am reading this link and I am very indignant, I can't think of anything but foul language. I'm just redesigning my indicator in 4 and it's just the beginning, not even much else, but already a hangup. I understand that the possibility for mql5 programming is great, but at what price. For me it's hard to say what was the optimization or upgrade of mql4 in mql5, in mql5 I haven't seen anything in real trading, it's just a gibberish. I don't know, maybe it's just emotions, I will see. All the same Thanks!
Good afternoon.
I'm trying to get the last value of a fractal:
Handle[Number]=iFractals(Symbol_,0);
CopyBuffer(Handle[Number],UPPER_LINE,4,100,Upper)
upenv[Number]=Upper[0];
but sometimes I get some strange number upenv[Number]=1.797693134862316e+308
If this number were 0, the problem would be solved this way
if(upenv[Number]=Upper[0] && Upper[0]!=0)
upenv[Number]=Upper[0];
Where is my mistake? What am I doing wrong? How can I get the last value of a fractal before it changes?
Problem solved!
if(upenv[Number]=Upper[0] && Upper[0]!=EMPTY_VALUE)
upenv[Number]=Upper[0];
It turns out that there is theEMPTY_VALUE constant.
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); }
Can you tell me, what is the approximate value of one credit on a marker?
Yes, one to one.