Questions from Beginners MQL5 MT5 MetaTrader 5 - page 196

 
barabashkakvn:

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 read this link and I am very indignant, I cannot think of anything but foul language. I'm just redesigning my indicator in 4 and it is only the beginning, not even anything else, but already there is a hang-up. 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. I have already implemented this in some mql4 but I have not managed to use it for many years.
 
Vikon:
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!
All will be fine and will build a coherent picture!
 
Vikon:
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!
I had the same thing when trying to mql4 to mql5. The habit is a scary thing. The first results did not appear instantly, but I had too many questions. I had to read articles and learn using other people's codes before my first EA started to trade in the Strategy Tester. But now I won't get into mql4 with any gingerbread, because there is too much possibilities there.
 
abeiks:

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.

 
I ask a question, but it is not displayed anywhere
 

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); }

 
You rewrite it yourself and ask what's wrong))
 
Can you tell me, what is the approximate value of one credit on a marker?
 
niktron:
Can you tell me, what is the approximate value of one credit on a marker?
Yes, one to one.
 
Silent:
Yes, one to one.
Thank you!