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

 
There is a function WindowIsVisible() that shows the state of the subwindow - visible or not.
How can I make an indicator subwindow invisible, preferably from the code? (if at all possible)
 
void OnStart()
  {
string s = "";
double p = 0;
         p = Point;
         p = NormalizeDouble(p, Digits);
         s = DoubleToString (p);
         Alert(s);  
  }

I wanted Alert to show the normalized point value. But it returns 0.00001000, it should be normalized after NormalizeDouble function?

 
JoinDoe:

I wanted Alert to show the normalized point value. But it returns 0.00001000, it should be normalized after NormalizeDouble function?

DoubleToStr() would help
 
Vinin:
DoubleToStr() will help
Thank you, it helped! But what if I need to do mathematical operations with Point? When it's output by Alert, it outputs a 16 digit number 1e-005.0. After normalization, it's 0.00001000. To display it, we need to convert it into a string form, but you can't perform arithmetic operations with a string. How can I cut off the extra 3 zeros at the end and still be able to perform mathematical operations?
 
JoinDoe:
Thank you, that helps! But what if I need to do mathematical operations with Point? When you output it by Alert, it outputs a 16 hex digit 1e-005.0. After normalization, it's 0.00001000. To display it, we need to convert it into a string form, but you can't perform arithmetic operations with a string. How can I cut off the extra 3 zeros at the end and still be able to perform mathematical operations?

And why are you bothered by extra zeros?

Storing and displaying numbers are slightly different things

 
JoinDoe:
Thank you, that helps! But what if I need to do mathematical operations with Point? When it is output by Alert, it outputs a 16-digit number 1e-005.0. After normalization it is 0.00001000. To display it, we need to convert it into a string form, but you can't perform arithmetic operations with a string. How can we make it possible to cut off 3 extra zeros at the end, and still be able to perform mathematical operations?
You do not need to do anything with it. Use it as it is. 1e-005 is an exponential form of notation. The number itself does not change depending on the form in which you display it.
 
There is an indicator buffer in the code, which is used to draw a line on the chart.
After N-bars this line is no longer needed, but the indicator continues to consume memory.

I have a question - if I just null the buffer values for the bars exceeding {0-N} -
will it free up memory?

 
atztek:
There is an indicator buffer in the code which is used to draw a line on the chart.
When N bars pass, this line is no longer needed, but the indicator continues to consume memory.

I have a question - if I just zero out the buffer values for bars outside {0-N} -
will it lead to memory freeing?

No
 
Vinin:
No
Am I correct in assuming that the only way to avoid memory overruns by indicator buffers is
to initially allocate some range for them (e.g. 0 to 2000) and not exceed it?
 
atztek:
Do I understand correctly, the only way to avoid memory overrun by indicator buffers is
to initially allocate a certain range for them (e.g. from 0 to 2000) and not exceed it?

The only way is to specify the minimum number of displayed bars in the terminal settings
Reason: