Questions from Beginners MQL5 MT5 MetaTrader 5 - page 745

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

A question to which I have not found a clear answer:

I need to use 2 indicators with four periods, is it necessary to handwrite one indicator 4 times in the init and the other 4 times?

Or it is possible to use one of them each time, otherwise it will be too many lines in the file.

I have no idea how to use it.

 
Vitaly Muzichenko:

A question to which I have not found a clear answer:

I need to use 2 indicators with four periods, is it necessary to handwrite one indicator 4 times in the init and the other 4 times?

Or it is possible to use one of them each time, otherwise it will be too many lines in the file.

I have no idea how to use it.

Imagine you need to open 8 doors, each with a different key. How many keys do you need to open all the doors?
 
Alexey Kozitsyn:
Imagine you need to open 8 doors, each with a different key. How many keys do you need to open all the doors?

One lockpick and no more.

Can I use it here, is there a possibility and I don't know about it? The work has stopped because of uncertainty(

 
Vitaly Muzichenko:

One lockpick and no more.

I can use it here, maybe there is a possibility and I don't know about it?

No, there's only keys.
 
Alexey Kozitsyn:
No, just the keys here.
Thank you, now I will do with confidence and not think about what can be done right.
 
Hello 2017.05.05_02:58 GMT+3. Who can tell me how to get the values of the last four ZigZag points and their indices or bar start times in MQL5 in the EA program code ? I've been struggling with it for a long time but nothing has come out so far. If I apply the while or for loop operator, it does not make any difference, the strategy tester generates an error in one of its logs: Array overrun in the include file. Here is the include file. I get the array of ZigZag values using the CopyBuffer() function and ZigZag handle. It seems to contain only ZigZag points, so I can't go through the array sequentially in ascending order. The array gets out of order. Maybe, Mr. Karputov knows how to get the last several ZigZag points without getting out of the array?
I even tried to change the ZigZag indicator code, but failed to rewrite it so that zero values were also written to indicator buffers. I tried to rewrite it in such a way that zero values would not exceed array limits during the array processing. So far, I haven't managed to understand completely what is written in ZigZag's code and how it works. I am bored with it, therefore I am writing on the forum.
I believe manual trading belongs to the past era. I don't have enough time to trade, I don't even want to get enough sleep and open deals during meals. I think I am able to write an Expert Advisor. I am not going to give up and give up. That's all for now. I am waiting for your reply. 03:28 GMT+3. Posted at 03:56 GMT+3.
Files:
TDiff.mqh  2 kb
 
Николай Никитюк:
Hello 2017.05.05_02:58 GMT+3. Who can tell me how to get the values of the last four ZigZag points and their indices or bar start times in MQL5 in the EA program code ? I've been struggling with it for a long time but nothing has come out so far. If I apply the while or for loop operator, it does not make any difference, the strategy tester generates an error in one of its logs: Array overrun in the include file. Here is the include file. I get the array of ZigZag values using the CopyBuffer() function and ZigZag handle. It seems to contain only ZigZag points, so I can't go through the array sequentially in ascending order. We get an array overrun.

No. All points are recorded there, including empty points.

Mykola Nikityuk:
I even tried to change the ZigZag indicator code, but it was not successful to rewrite it in such a way, that also zero values were written into indicator buffers. I have not managed to rewrite it in such a way that it would not overrun arrays when processing them by the loop. So far, I haven't managed to understand completely what is written in ZigZag's code and how it works. I am bored with it, therefore I am writing on the forum.
I believe manual trading belongs to the past era. I don't have enough time to trade, I don't even want to get enough sleep and open deals during meals. I think I am able to write an Expert Advisor. I am not going to give up and give up. That's all for now. I am waiting for your reply. 03:28 GMT+3. Posted at 03:56 GMT+3.

To get rid of the array bounds, you should deal with array directions.

In order to get the indexes or time of bars we should copy the time of bars CopyTime() or CopuRates() along with the copying of indicator buffer, where the OHLC of bars also exists.

Since we can't avoid the cycle, I would use the second form of the function

int  CopyBuffer(
   int       indicator_handle,     // handle индикатора
   int       buffer_num,           // номер буфера индикатора
   datetime  start_time,           // с какой даты
   int       count,                // сколько копируем
   double    buffer[]              // массив, куда будут скопированы данные
   );

The next condition: if a value larger than zero is copied, that is a ZigZag point and we will get the upper or lower extremum by comparing that value with High and Low of that bar.

 

People, please help me to understand what the hell is going on in MQL5 with order bookkeeping.

I am dealing with programmers and it seems that we are not able to have orders clearly based on the principles used in MQL4 - we cannot set a magic number for an order, then it is impossible to select necessary positions based on a magic number by simply trying OrdersTotal() and detect which order was opened by an EA and which was opened manually, etc., we cannot close a certain order based on a ticket, and it is impossible to create a ladder of orders in one direction and then close the oldest order, etc.

Could metaquotes really do such a shit? How can we work without it?

 
Artyom Kuraev:

People, please help me to understand what the hell is going on in MQL5 with order bookkeeping.

I am dealing with programmers and my impression is that we are unable to correctly count orders according to that principle which was used in MQL4 - you can not set a magic number for an order, you can not simply use OrdersTotal() to select necessary positions based on a magic number and then determine which order was opened by an EA and which was opened manually, etc., you cannot close a certain order according to a ticket, you cannot create a ladder of orders in one direction and then close the earliest of them, etc.

Could the meta-quotes have done this crap? How can you work without it?

Where do you find such programmers?

All of this is absolute nonsense. Where to send such a programmer, I hope you understand.

Well, just in case, so I don't miss it, here's a pointer.