Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1435

 

Renat, please give a recommendation or any other comment

on difficult issues for me, on the last pagehttps://www.mql5.com/ru/forum/160683/page1434#comment_21634884

prints of the robot I can provide from 3 treminals, there are 2 passes in them
 

Can you tell me how to add funds to your account and how to withdraw funds (where the top-up and withdrawal buttons are located)?

 
feniok83:

Can you tell me how to deposit your trading account and how to withdraw it (where are the deposit and withdrawal buttons)?

To the personal account on the broker's website.

 

When setting the properties of mql5 buffer, is there any dependency in the order of properties ?

SetIndexBuffer(0,Buffer1,INDICATOR_DATA);
SetIndexBuffer(1,Buffer2,INDICATOR_CALCULATIONS);
SetIndexBuffer(2,Buffer3,INDICATOR_DATA);

Or first specify date, then calculations?

SetIndexBuffer(0,Buffer1,INDICATOR_DATA);
SetIndexBuffer(1,Buffer2,INDICATOR_DATA);
SetIndexBuffer(2,Buffer3,INDICATOR_CALCULATIONS);

The type in indexing of buffers will change, it's clear, we don't consider it.
What I am interested in is the sequence of the properties themselves.
Does the sequence of properties affect the correctness or not?

The question arose from the following situation.
I try to calculate the second indicator by the values of the first indicator within one programme.
I try to display the result of the second indicator in (4 , Buffer5, INDICATOR_DATA)
But it can't be displayed, it just doesn't show.
I printBuffer5[] to check, everything is correct in printers. It turns out that the problem is in displaying.
I do not understand where to dig. #property all seem to be set correctly.
Buffer1 and
Buffer2 are displayed, but Buffer5 doesn't want to.
I've tried using dynamic property PlotIndexSetInteger(), same result.
Buffer5 is not displayed.
Buffer1 andBuffer2 are set as series and values are recorded for(int i=limit; i>=0; i--)
Buffer5 is set as regular array and values are recorded for(int i=pos; i<total-1; i++)
i.e. values of all buffers are written from left to right. There should not be any problems here. No errors or warnings.
Where should I dig?

#property indicator_buffers 7
#property indicator_plots   3

//--------------------------------------------------
//indicator1
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrGoldenrod
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

#property indicator_type2   DRAW_LINE
#property indicator_color2  clrGoldenrod
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1

#property indicator_type3   DRAW_NONE
#property indicator_type4   DRAW_NONE

//indicator2
#property indicator_type5   DRAW_ARROW
#property indicator_color5  clrGoldenrod
#property indicator_style5  STYLE_DOT
#property indicator_width5  1

#property indicator_type6   DRAW_NONE
#property indicator_type7   DRAW_NONE

//--------------------------------------------------
//indicator1 buffers
SetIndexBuffer(0, Buffer1,   INDICATOR_DATA);
SetIndexBuffer(1, Buffer2,   INDICATOR_DATA);
SetIndexBuffer(2, Buffer3,   INDICATOR_CALCULATIONS);
SetIndexBuffer(3, Buffer4,   INDICATOR_CALCULATIONS);
//indicator2 buffers 
SetIndexBuffer(4, Buffer5,   INDICATOR_DATA);
SetIndexBuffer(5, Buffer6,   INDICATOR_CALCULATIONS);
SetIndexBuffer(6, Buffer7,   INDICATOR_CALCULATIONS);
 
Roman:

When setting the properties of mql5 buffer, is there any dependency in the order of properties ?

Or first specify date, then calculations?

The type in indexing of buffers will change, it's clear, we don't consider it.
What I am interested in is the sequence of the properties themselves.
Does the sequence of properties affect correctness or not?

Only the sequence of the data buffer and colour buffer affects correctness.

Generally, if a build has 2-3-4 buffers, they should be in a row.

There is no difference in your example, but it's nicer to have the second option so that you don't confuse the buffer number with the build number.

 
Alexey Viktorov:

Only the sequence of the data buffer and colour buffer is affected.

Generally, if a build has 2-3-4 buffers, they should be in a row.

In your example there is no difference, but it's nicer to have the second option so that you don't confuse the buffer number with the build number.

I have set this sequence of buffer properties

#property indicator_buffers 7
#property indicator_plots   3

//--------------------------------------------------
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrGoldenrod
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1

#property indicator_type2   DRAW_LINE
#property indicator_color2  clrGoldenrod
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1

#property indicator_type3   DRAW_ARROW
#property indicator_color3  clrGoldenrod
#property indicator_style3  STYLE_DOT
#property indicator_width3  1

#property indicator_type4   DRAW_NONE
#property indicator_type5   DRAW_NONE
#property indicator_type6   DRAW_NONE
#property indicator_type7   DRAW_NONE

//--------------------------------------------------
//indicator1 buffers
SetIndexBuffer(0, Buffer1, INDICATOR_DATA);
SetIndexBuffer(1, Buffer2, INDICATOR_DATA);
SetIndexBuffer(2, Buffer5INDICATOR_DATA);
SetIndexBuffer(3, Buffer3, INDICATOR_CALCULATIONS);
SetIndexBuffer(4, Buffer4, INDICATOR_CALCULATIONS);
SetIndexBuffer(5, Buffer6, INDICATOR_CALCULATIONS);
SetIndexBuffer(6, Buffer7, INDICATOR_CALCULATIONS);

I.e. all displayed INDICATOR_DATA first, then all INDICATOR _CALCULATIONS
#property is edited to sequence
and oh my god, all three buffers are displayed.
It turns out there is a dependency, first we put all the date, then all the calculations.

 
Roman:

I have set the sequence of buffer properties as follows

i.e. first all displayed INDICATOR_DATA , then all INDICATOR _CALCULATIONS
#property edited to sequence
and oh my god, all three buffers are displayed.
It turns out there is a dependency, first put all date, then all calculations.

I haven't experimented with it, but I think it's possible to get it to work with inconsistently declared mapping buffers as well. I'll experiment with it if I get bored.(if I don't forget).

Just these lines

#property indicator_type4   DRAW_NONE
#property indicator_type5   DRAW_NONE
#property indicator_type6   DRAW_NONE
#property indicator_type7   DRAW_NONE
are unnecessary. Buffers 4-7 are declared as auxiliary and are in no way related to the constructions.
 
Alexey Viktorov:

I haven't experimented with this, but I think it's possible to make it work with inconsistently declared mapping buffers as well. I'll experiment with it if I get bored.(if I don't forget).

Only these lines

I consider them unnecessary. Buffers 4-7 are declared as auxiliary and have no relation to constructions.

I tried to comment out

#property indicator_type4   DRAW_NONE
#property indicator_type5   DRAW_NONE
#property indicator_type6   DRAW_NONE
#property indicator_type7   DRAW_NONE

and displaying of all three constructions became incorrect.
I uncommented them, everything is back to normal.
It turns out the compiler needs them.

 
Roman:

It turns out there is a dependency, putting all the date first, then all the calculations.

Yes, and the sequence of regular buffers (histograms - arrows - lines) is also important.
Killed a few hours recently looking for a "bug" - why simple buffers weren't all displayed on the chart.

When there are dozens of buffers, adding a new one is a hassle.

 
Taras Slobodyanik:

Yes, and the consistency of the regular buffers (histograms-arrows-lines) is also important.
I've recently spent hours looking for a "bug" - why simple buffers don't all show up on the chart.

When there are dozens of buffers it's a hassle to add a new one.

Yes, the logic of the language with indicator buffers is not the best. Somewhere I saw, indicator buffers in µl require full description in correct sequence. And this is correct and not convenient.