Data Window

Back to topics list To post a new topic, please log in or register
avatar
2
fxbob 2015.09.05 02:04
 

Hi,

I've looked and looked and have learned a lot but not what started this hunt in the first place.

I got a file from the code base: PriceAlert. It's pretty basic and it does what I need it to do. Though I'm trying to learn mql4 so I wanted to add something to the code.
The code allows you to put lines on a chart and you will be alerted when a line is crossed.

I would like to add the line values to the data window which at first I thought would be relatively straight forward. However this doesn't seem to be the case.

I believe the issue is that the value that I want to display is an extern double, thusly: extern double SoundWhenPriceGoesAbove = 0;

I thought it would be just a matter of putting this variable into SetIndexBuffer like this:   SetIndexBuffer(1, SoundWhenPriceGoesAbove);

But that doesn't work.

I've tried this variations of code but just can't get it to work.

Any ideas?

Thanks
Bob 

avatar
Moderator
3404
GumRai 2015.09.05 04:26 #
 

You can't give a buffer a value with SetIndexBuffer

You have to assign a value to each index in the buffer array in the main code

avatar
125
zirkoner 2015.09.05 12:13 #
 

fxbob:

...

I thought it would be just a matter of putting this variable into SetIndexBuffer like this:   SetIndexBuffer(1, SoundWhenPriceGoesAbove);

But that doesn't work.

I've tried this variations of code but just can't get it to work.

Any ideas?

Thanks
Bob 

I fear you will have to continue to learn :-)

SetIndexBuffer() requires an array.

avatar
2
fxbob 2015.09.05 18:21 #
 

So not near as easy as I thought.

Yup, more learning. But then, that's the fun of the whole thing, isn't it?

If it's not fun, don't do it.

 Thanks guys. At least I now have a little better direction

Bob 

avatar
12983
WHRoeder 2015.09.05 21:19 #
 
You can only SetIndexBuffer and that only works for indicator buffers.
Back to topics list  

To add comments, please log in or register