View Single Post
  #3 (permalink)  
Old 11-07-2005, 04:23 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up Great questions!

Hi newdigital,

Thank you very much for your GREAT questions.

Quote:
Originally Posted by newdigital
I have the questions.

1. You described about
#property indicator_buffer 1
Why do we need this buffer? What is it?
1- you misspelled the code #property indicator_buffers 1 (don't miss the s in buffer )
2- indicator_buffers is the number of memory allocated to draw your line(s). When you set the number (up to 8) you are telling MQL4: “Please allocate a memory buffer for me to draw my line”.
3- We need indicator_buffers when we need to draw lines.

Quote:
Originally Posted by newdigital
2. We wrote:
double ExtMapBuffer1[]
And you described about arrays. As I understand we may use
int my_array [2] = {30, 70}
when
#property indicator_minimum 0
#property indicator_maximum 100
and we need to draw two horizontal lines (for example).
And if not 30 and 70. But 30.5 and 60.5 we will use double instead of int?
You are right!

The data type of #property indicator_maximum & #property indicator_minimum is integer in the MQL4 guide. I forgot to mention that was wrong.
They actually are double. So, you can use something like that:
#property indicator_maximum 40.50
#property indicator_minimum 1.10

Quote:
Originally Posted by newdigital
3. Why
double ExtMapBuffer1[] ?
Is it always ExtMapBuffer and we need just remember it?
You can use any name you want. MQL4 wizard added this array and chose this name. It's good programming practice to leave it as it.

Quote:
Originally Posted by newdigital
4. int ExtCountedBars = 0
It means we are counting everything using curent zero bar. But in some cases we need to xalculate high or low for 300 bars for example.
Should we use
int ExtCountedBars = 300 ?
But if we need to change it from time to time we will use in property?
#property ????

1- You can use any value you want instead of 0.
2- ExtCountedBars is a variable not a property.
3- If you want to enable the user to change this value use:
extern int ExtCountedBars = 0;
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote