Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 926

 
AlexeyVik:

Depending on the number of lines, declare indicator buffers and simultaneously write value to one of the buffers where the line is drawn. And then read this value from the Expert Advisor through iCustom().

It is in two words.

Do you know that when drawing the line, you specify start time and end time and price respectively. For the buffer, a loop must be drawn over all the bars. You should first look through the code and then give pieces of advice. Otherwise your advice is useless 0......
 
nikelodeon:
Do you know that when drawing the line, you specify start time and end time and, correspondingly, the price. The buffer should loop through all the bars. You should have looked through the code first, and then give pieces of advice. Otherwise your advice is useless 0......

You have to put the price in the buffer.

And the loop is only needed to ensure that the readings are for all bars. To be more precise, it is just for beauty, and as a rule, everybody works with readings of the last two bars, 0 and 1.

If an indicator does not contain processing of all bars, it seems that it is not necessary.

I'm just as lazy as many others to grasp the code, maybe even lazier than all of them together, and you advise me to look at the code... what do I need? I asked in a nutshell. Whatever the question, that's the answer. And if my advice is useless, it means I'm advising the wrong guy.

 
AlexeyVik:

It's the price that needs to be put in the buffer.

And the loop is only needed to ensure that the readings are for all bars. To be more precise, it is just for beauty, and as a rule, everybody works with readings of the last two bars, 0 and 1.

If your indicator doesn't contain processing of all bars, you probably don't need it.

I'm just as lazy as most people to dig through this code, and maybe even lazier than all of them together, and you're advising me to look at the code... what do I need? I asked in a nutshell. Whatever the question, that's the answer. And if my advice is useless, it means I'm advising the wrong guy.

I do not really want to, although I'm not a very good programmer, but I do write code, no matter how ugly it may be. And the essence of the question is this. HOW to arrange a loop for the buffer to display the levels of options on the history. So that we can then work with this history, check the hypothesis and save the data. We need to organize a competent loop. I think this is where the task becomes interesting...... But I can't think of any ideas.... how to do it. I feel it is necessary to bind to dates and somehow dance from them. But there is a problem with timeframe. In general, it turns out to be quite a problem .... I would like to hear an opinion on more details. And the fact that in the buffer you need to write the price!!!! I'm not that dumb, believe me, not to understand it.....

 
I think we should wait until the beginning of the week and see if the pros come back from the countryside and start advising.....
 
nikelodeon:

I'm not really a programmer, but I still write code, no matter how crooked it is. And the very essence of the question is. HOW to arrange a loop for the buffer to display the levels of options on the history. So that we can then work with this history, check the hypothesis and save the data. We need to organize a competent loop. I think this is where the task becomes interesting...... But I can't think of any ideas.... how to do it. I feel it is necessary to bind to dates and somehow dance from them. But there is a problem with timeframe. In general, it turns out to be quite a problem .... I would like to hear an opinion on more details. And the fact that in the buffer you need to write the price!!!! I'm not that dumb, believe me, not to understand it.....

So there it is, the whole loop is in place and organised correctly and the buffers fill up.

 for(i=limit; i>=0; i--){  
      if ((Close[i+5]>Level1)&&(Open[i+5]>Level1)&&(Close[i]>Level1)&&(Open[i]>Level1)&&(Close[i+1]>Level1)&&(Open[i+1]>Level1)&&(Close[i+2]>Level1)&&(Open[i+2]>Level1)&&(Close[i+3]>Level1)&&(Open[i+3]>Level1)&&(Close[i+4]>Level1)&&(Open[i+4]>Level1)) qLevel1=Level1+EnterUP;  
      if ((Close[i+5]<Level1)&&(Open[i+5]<Level1)&&(Close[i]<Level1)&&(Open[i]<Level1)&&(Close[i+1]<Level1)&&(Open[i+1]<Level1)&&(Close[i+2]<Level1)&&(Open[i+2]<Level1)&&(Close[i+3]<Level1)&&(Open[i+3]<Level1)&&(Close[i+4]<Level1)&&(Open[i+4]<Level1)) qLevel1=Level1-EnterDw;  
      if ((Close[i+5]>Level2)&&(Open[i+5]>Level2)&&(Close[i]>Level2)&&(Open[i]>Level2)&&(Close[i+1]>Level2)&&(Open[i+1]>Level2)&&(Close[i+2]>Level2)&&(Open[i+2]>Level2)&&(Close[i+3]>Level2)&&(Open[i+3]>Level2)&&(Close[i+4]>Level2)&&(Open[i+4]>Level2)) qLevel2=Level2+EnterUP;  
      if ((Close[i+5]<Level2)&&(Open[i+5]<Level2)&&(Close[i]<Level2)&&(Open[i]<Level2)&&(Close[i+1]<Level2)&&(Open[i+1]<Level2)&&(Close[i+2]<Level2)&&(Open[i+2]<Level2)&&(Close[i+3]<Level2)&&(Open[i+3]<Level2)&&(Close[i+4]<Level2)&&(Open[i+4]<Level2)) qLevel2=Level2-EnterDw;  
      if ((Close[i+5]>Level3)&&(Open[i+5]>Level3)&&(Close[i]>Level3)&&(Open[i]>Level3)&&(Close[i+1]>Level3)&&(Open[i+1]>Level3)&&(Close[i+2]>Level3)&&(Open[i+2]>Level3)&&(Close[i+3]>Level3)&&(Open[i+3]>Level3)&&(Close[i+4]>Level3)&&(Open[i+4]>Level3)) qLevel3=Level3+EnterUP;  
      if ((Close[i+5]<Level3)&&(Open[i+5]<Level3)&&(Close[i]<Level3)&&(Open[i]<Level3)&&(Close[i+1]<Level3)&&(Open[i+1]<Level3)&&(Close[i+2]<Level3)&&(Open[i+2]<Level3)&&(Close[i+3]<Level3)&&(Open[i+3]<Level3)&&(Close[i+4]<Level3)&&(Open[i+4]<Level3)) qLevel3=Level3-EnterDw;  
      if ((Close[i+5]>Level4)&&(Open[i+5]>Level4)&&(Close[i]>Level4)&&(Open[i]>Level4)&&(Close[i+1]>Level4)&&(Open[i+1]>Level4)&&(Close[i+2]>Level4)&&(Open[i+2]>Level4)&&(Close[i+3]>Level4)&&(Open[i+3]>Level4)&&(Close[i+4]>Level4)&&(Open[i+4]>Level4)) qLevel4=Level4+EnterUP;  
      if ((Close[i+5]<Level4)&&(Open[i+5]<Level4)&&(Close[i]<Level4)&&(Open[i]<Level4)&&(Close[i+1]<Level4)&&(Open[i+1]<Level4)&&(Close[i+2]<Level4)&&(Open[i+2]<Level4)&&(Close[i+3]<Level4)&&(Open[i+3]<Level4)&&(Close[i+4]<Level4)&&(Open[i+4]<Level4)) qLevel4=Level4-EnterDw;  
      if ((Close[i+5]>Level5)&&(Open[i+5]>Level5)&&(Close[i]>Level5)&&(Open[i]>Level5)&&(Close[i+1]>Level5)&&(Open[i+1]>Level5)&&(Close[i+2]>Level5)&&(Open[i+2]>Level5)&&(Close[i+3]>Level5)&&(Open[i+3]>Level5)&&(Close[i+4]>Level5)&&(Open[i+4]>Level5)) qLevel5=Level5+EnterUP;  
      if ((Close[i+5]<Level5)&&(Open[i+5]<Level5)&&(Close[i]<Level5)&&(Open[i]<Level5)&&(Close[i+1]<Level5)&&(Open[i+1]<Level5)&&(Close[i+2]<Level5)&&(Open[i+2]<Level5)&&(Close[i+3]<Level5)&&(Open[i+3]<Level5)&&(Close[i+4]<Level5)&&(Open[i+4]<Level5)) qLevel5=Level5-EnterDw;  
      if ((Close[i+5]>Level6)&&(Open[i+5]>Level6)&&(Close[i]>Level6)&&(Open[i]>Level6)&&(Close[i+1]>Level6)&&(Open[i+1]>Level6)&&(Close[i+2]>Level6)&&(Open[i+2]>Level6)&&(Close[i+3]>Level6)&&(Open[i+3]>Level6)&&(Close[i+4]>Level6)&&(Open[i+4]>Level6)) qLevel6=Level6+EnterUP;  
      if ((Close[i+5]<Level6)&&(Open[i+5]<Level6)&&(Close[i]<Level6)&&(Open[i]<Level6)&&(Close[i+1]<Level6)&&(Open[i+1]<Level6)&&(Close[i+2]<Level6)&&(Open[i+2]<Level6)&&(Close[i+3]<Level6)&&(Open[i+3]<Level6)&&(Close[i+4]<Level6)&&(Open[i+4]<Level6)) qLevel6=Level6-EnterDw;  
      if ((Close[i+5]>Level7)&&(Open[i+5]>Level7)&&(Close[i]>Level7)&&(Open[i]>Level7)&&(Close[i+1]>Level7)&&(Open[i+1]>Level7)&&(Close[i+2]>Level7)&&(Open[i+2]>Level7)&&(Close[i+3]>Level7)&&(Open[i+3]>Level7)&&(Close[i+4]>Level7)&&(Open[i+4]>Level7)) qLevel7=Level7+EnterUP;  
      if ((Close[i+5]<Level7)&&(Open[i+5]<Level7)&&(Close[i]<Level7)&&(Open[i]<Level7)&&(Close[i+1]<Level7)&&(Open[i+1]<Level7)&&(Close[i+2]<Level7)&&(Open[i+2]<Level7)&&(Close[i+3]<Level7)&&(Open[i+3]<Level7)&&(Close[i+4]<Level7)&&(Open[i+4]<Level7)) qLevel7=Level7-EnterDw;  
      if ((Close[i+5]>Level8)&&(Open[i+5]>Level8)&&(Close[i]>Level8)&&(Open[i]>Level8)&&(Close[i+1]>Level8)&&(Open[i+1]>Level8)&&(Close[i+2]>Level8)&&(Open[i+2]>Level8)&&(Close[i+3]>Level8)&&(Open[i+3]>Level8)&&(Close[i+4]>Level8)&&(Open[i+4]>Level8)) qLevel8=Level8+EnterUP;  
      if ((Close[i+5]<Level8)&&(Open[i+5]<Level8)&&(Close[i]<Level8)&&(Open[i]<Level8)&&(Close[i+1]<Level8)&&(Open[i+1]<Level8)&&(Close[i+2]<Level8)&&(Open[i+2]<Level8)&&(Close[i+3]<Level8)&&(Open[i+3]<Level8)&&(Close[i+4]<Level8)&&(Open[i+4]<Level8)) qLevel8=Level8-EnterDw;  
      if ((Close[i+5]>Level9)&&(Open[i+5]>Level9)&&(Close[i]>Level9)&&(Open[i]>Level9)&&(Close[i+1]>Level9)&&(Open[i+1]>Level9)&&(Close[i+2]>Level9)&&(Open[i+2]>Level9)&&(Close[i+3]>Level9)&&(Open[i+3]>Level9)&&(Close[i+4]>Level9)&&(Open[i+4]>Level9)) qLevel9=Level9+EnterUP;  
      if ((Close[i+5]<Level9)&&(Open[i+5]<Level9)&&(Close[i]<Level9)&&(Open[i]<Level9)&&(Close[i+1]<Level9)&&(Open[i+1]<Level9)&&(Close[i+2]<Level9)&&(Open[i+2]<Level9)&&(Close[i+3]<Level9)&&(Open[i+3]<Level9)&&(Close[i+4]<Level9)&&(Open[i+4]<Level9)) qLevel9=Level9-EnterDw;  
      if ((Close[i+5]>Level10)&&(Open[i+5]>Level10)&&(Close[i]>Level10)&&(Open[i]>Level10)&&(Close[i+1]>Level10)&&(Open[i+1]>Level10)&&(Close[i+2]>Level10)&&(Open[i+2]>Level10)&&(Close[i+3]>Level10)&&(Open[i+3]>Level10)&&(Close[i+4]>Level10)&&(Open[i+4]>Level10)) qLevel10=Level10+EnterUP;  
      if ((Close[i+5]<Level10)&&(Open[i+5]<Level10)&&(Close[i]<Level10)&&(Open[i]<Level10)&&(Close[i+1]<Level10)&&(Open[i+1]<Level10)&&(Close[i+2]<Level10)&&(Open[i+2]<Level10)&&(Close[i+3]<Level10)&&(Open[i+3]<Level10)&&(Close[i+4]<Level10)&&(Open[i+4]<Level10)) qLevel10=Level10-EnterDw;  
      
Buffer1[i]=qLevel1;      
Buffer2[i]=qLevel2;      
Buffer3[i]=qLevel3;      
Buffer4[i]=qLevel4;      
Buffer5[i]=qLevel5;      
Buffer6[i]=qLevel6;      
Buffer7[i]=qLevel7;      
Buffer8[i]=qLevel8;      
Buffer9[i]=qLevel9;           
Buffer10[i]=qLevel10;  
//Buffer11[i]=LevelsVerticalShift;
 }

But there must be some file to this indicator. What should be in it is not known.

 
nikelodeon:

Save the values of the Trend lines (horizontal segments) to Terminal variables, which for each line can take the form of array elements (if you want to read them in a loop): {Line[0][0], Line[0][1], Line[0][2]..}, {Line[1][0], Line[1][1], Line[1][2]..}, etc. One more term variable "Status 0/1" is needed to indicate to another indicator/advisor when parameters of a new line should be read, after which "Status" should be returned to initial position. If lines are read not all at once, but as they come in, you can do with only one set Line[][].
 
AlexeyVik:

So there it is, the whole loop is in place and organised correctly and the buffers are filling up.

But there must be a file to this indicator. What should be in it is not known.

Who does such awful things. Can't the author think it over?
 
Vinin:
Who does such scary things? Can't the author think about it?
What about me? I'm not the author... I didn't even have a drink with him.
 
DD! I can't open one window in the terminal. It's frozen to the core. Some indicator hangs there and does not allow to open the window. Please advise how can I see what indicators are set on this chart. I want to use it as a base for my trading robot.
 
smart:
DD! I can't open one window in the terminal. It's frozen to the core. Some indicator hangs there and does not allow to open the window. Please advise how can I see what indicators are set on this chart. My apologies!
You have to look in the "profiles" folder.
Look at the name of the active profile and in its folder in the chart*** files you will find indicators, one of them is causing problems. It is easier to change the name of the folder "profiles" to "profiles_" when MT4 is off, and after the restart MT4 will generate a new one - all at your own risk! ;-)))
Reason: