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

 
Comrades!

There is a need to output the indicator in segments.
It is desirable to clear the buffer, so as not to display old data on the chart.

The problem is:
1. You can't clear the array, an error will appear (out of range).
2. When zeroing the data accordingly the graph crawls to zero.

Advice on which direction to dig. Thank you.
 
Hello, the indicator in ex4 is very CPU intensive, if I make an indicator that pulls its buffers not on every tick but (in one, two) and put it instead of ex4 will it help the processor?
 
Андрей:
Hi. The indicator in ex4 puts a lot of load on the processor, if I make an indicator that pulls its buffers not on every tick but (in one, two) and put it instead of ex4 will it help the processor?
I would choose two approaches:
- Either work with the buffer on a new bar;
- or update the buffer on a limited time period.
 
terentjew23:
I would take two approaches:
- Either work with the buffer on a new bar;
- or update the buffer on a limited time period.
I would choose the third option. I would throw out such an indicator so that no one would ever be able to find it.
 
terentjew23:
Comrades!

There is a need to display the indicator in segments.
It is desirable to clear the buffer, so as not to display old data on the chart.

The problem is:
1. you can't clear the array, an error comes out (out of range).
2. When the data is zeroed, accordingly the graph crawls to zero.

Advice on what direction to dig. Thank you.
Try putting EMPTY_VALUE instead of zero
 

I put in indicators and advisers

int init()
  {
   if(Digits==5){if(Close[0]>1)plus=0.00003; else plus=0.00002;}
   if(Digits==3){if(Close[0]>100)plus=0.003; else plus=0.002;}
}


void start()
  {
   if(time0!=Time[0]){ time0=Time[0]; hig=0; loww=1000;} 


   if((High[0]>hig)||(Low[0]<loww))  {hig=High[0]+plus; loww=Low[0]-plus;

код здесь, поскольку интересуют пиковые моменты индикаторов

хочу так
буфер_0=iCustom(NULL,0,"1rd",1,0);


}
 
Alexey Viktorov:
Try putting EMPTY_VALUE instead of zero
Thank you, it helped.
 

how to do it:

let's say I have an account balance of 5800

if (5800)\2000= (in this case it should come out 2, all fractions are discarded, we need the functions themselves for such processing)

 
trader781:
just like 1800\2000=1
No. It will be 0.
 
Alexey Kozitsyn:
No. It will be 0.
I erased that part because I'm going to have to do it separately.
Reason: