Drawing too many buffer lines

To add comments, please log in or register
SirFency
173
SirFency  

I have 100 index buffers. I only want to draw 8 lines. The rest are there for calculation. How to I only draw 8. I have the ones I want to draw set to the first 8 indexes (0-7) I dont know how to stop the rest from drawing other than opening up the indicator settings window and setting the color to None. There must be an easier way in code.

I was thinking something like this but I dont know the correct syntax.


  if(SetIndexBuffer > 7){
  clrNONE;
  }
GrumpyDuckMan
882
GrumpyDuckMan  
SirFency:

I have 100 index buffers. I only want to draw 8 lines. The rest are there for calculation. How to I only draw 8. I have the ones I want to draw set to the first 8 indexes (0-7) I dont know how to stop the rest from drawing other than opening up the indicator settings window and setting the color to None. There must be an easier way in code.

I was thinking something like this but I dont know the correct syntax.


Hello friend,

Post your indicator code so we can all learn something.

SirFency
173
SirFency  
GrumpyDuckMan:

Hello friend,

Post your indicator code so we can all learn something.

The code is getting pretty big. I'll attach it.

Mladen Rakic
160516
Mladen Rakic  
SirFency:

The code is getting pretty big. I'll attach it.

//
//-- first set the number of buffers that are going to be drawn
//

#property indicator_buffers 8

//
//--- change the start of OnInit() to this - increasing the total number of run-time used buffers to 100
//

int OnInit()
  {
  IndicatorBuffers(100);
  
kypa
1079
kypa  
#property indicator_buffers 10000000
#property indicator_plots 8
Also the plots should be the first 8 buffers and (in OnInit) should be defined as indicator_calculations.
SirFency
173
SirFency  
I appreciate the help guys but Neither of these suggestions solved the issue. I have tried both suggestions individually and then started playing with different combinations of the two suggestions and each time when I apply the indicator to my chart when the little window pops up I go to the colors tab. I see the first 8 colors are correct (0-7) then I see all the other buffers are showing up and black (8-99).
Mladen Rakic
160516
Mladen Rakic  
SirFency:
I appreciate the help guys but Neither of these suggestions solved the issue. I have tried both suggestions individually and then started playing with different combinations of the two suggestions and each time when I apply the indicator to my chart when the little window pops up I go to the colors tab. I see the first 8 colors are correct (0-7) then I see all the other buffers are showing up and black (8-99).

Did you (try)?


all the best

SirFency
173
SirFency  
Mladen Rakic:

Did you (try)?


all the best

Well I'm dumbfounded. Both my file and your file are exactly the same Mladen. Yours works great. Mine still has all the black lines. I dont understand that at all. I went through both files side by side to make sure each line matched perfectly and they do. My file must be corrupted somehow.

William Roeder
20233
William Roeder  
kypa: Also the plots should be the first 8 buffers and (in OnInit) should be defined as indicator_calculations.

Please stop posting MT5 code in the MT4 forum. There is no indicator_plots.

SirFency
173
SirFency  
whroeder1:

Please stop posting MT5 code in the MT4 forum. There is no indicator_plots.

Thank you. I was losing my mind trying to find this in my documentation.

To add comments, please log in or register