Download MetaTrader 5

icustom calling - page 2

To add comments, please log in or register
MirTD
220
MirTD  
RaptorUK:
Probably because it is easier to ask, I am sure we have all done that on occasion.

RaptorUK, yeah,surely it is easier to ask but the problem is one hardly gets the right answer(I do get the right answer here thnx).but I hardly ask a question if I can think it out in 1 minute or googled and find it in lesser time!i think forum is also one such way to find solutions!

Simon Gniadkowski
Moderator
18036
Simon Gniadkowski  
MirTD:

RaptorUK, yeah,surely it is easier to ask but the problem is one hardly gets the right answer(I do get the right answer here thnx).but I hardly ask a question if I can think it out in 1 minute or googled and find it in lesser time!i think forum is also one such way to find solutions!

I spent 2 hours yesterday trying to figure out why FileIsEnding() wasn't doing what I thought it should be doing . . . I could have asked but I learned more figuring it out myself.
whroeder1
16096
whroeder1  
MirTD:

particularly, the value-feed line-array with setindex 2 feeds values to two other line-arrays with index 0 and 1 depending on happening of certain conditions.

I hope it is clear to any coders now.(I did experience a situation like that mention earlier in my first post and its DIRECTLY related to using icustom)

Still bogus. What is a value-feed? What is a line-array? A line has nothing to do with arrays.

Do you mean "particularly, the calculation is placed in the third buffer (the array with SetIndexBuffer(2)) and then to one of the other two buffers depending on certain conditions"?

MirTD
220
MirTD  
WHRoeder:

Still bogus. What is a value-feed? What is a line-array? A line has nothing to do with arrays.

Do you mean "particularly, the calculation is placed in the third buffer (the array with SetIndexBuffer(2)) and then to one of the other two buffers depending on certain conditions"?


Do you mean "particularly, the calculation is placed in the third buffer (the array with SetIndexBuffer(2)) and then to one of the other two buffers depending on certain conditions"?

that's right.

What is a value-feed? What is a line-array? A line has nothing to do with arrays.

lol(this is not a proper English word) .you may refer also https://www.google.co.in/?gws_rd=cr#bav=on.2,or.r_cp.r_qf.&fp=cf0ab5463556c338&psj=1&q=data+feed+into+variables,

https://www.google.co.in/?gws_rd=cr#bav=on.2,or.r_cp.r_qf.&fp=cf0ab5463556c338&psj=1&q=what+is+a+line+in+mathematics%3F

well you may have confused.also i sometimes use self-understood technical jargon like TOPB=TRADE ONCE PER BAR:AOPB=ALERT ONCE PER BAR etc.

clarification:

1.i used three buffers

2.when certain trade conditions happen

3.third indicator buffer data values is feed into the first or second indicator buffer, all of which are Array buffers

4.depending on the third-indicator array-values received by one of the buffers,a line is drawn with different colors

5.i used an icustom() to access this third buffer values by setting shift value to 0,then 1 and then 2

6. the EA works in all the case(which is a surprise!)

7.But when I assign shift value to 4(which does not exist),the EA does not work

8.there is no problem in the indicator whose datas are being access

9.then the only problem must be in the icustom().

that's the side problem I faced which was added to the first post.

well it seems like I have to checked the return values as mentioned by RaptorUK and SDC.

if I do not get the correct/expected data even after thorough test(I have partially checked the values and get unexpected values),it will be a real headach!

Ian Venner
2584
Ian Venner  

when you say you set the shift value to 4 what do you mean by the shift ? Usually when we talk about the shift value we mean the bar shift; bar0, bar1, bar2 etc. Did you mean to say the buffer index value ?

If it is the buffer index you are talking about then of course it wont work when you set it to call buffer 4 on an indicator with only 3 buffers.

MirTD MirTD2013.08.19 16:01#

5.i used an icustom() to access this third buffer values by setting shift value to 0,then 1 and then 2

7.But when I assign shift value to 4(which does not exist),the EA does not work

I may have misinterpreted your post but those two comments lead me to believe you may have some confusion with the last two parameters in iCustom(). The one before last is the buffer index, (called mode in the documentation) you would use that parameter to call one of your indicator buffers, probably 0,1 or 2 from your three buffer indicator. The last parameter is the bar shift, used to get the value from the buffer you nominated in the previous parameter, at the current bar or from a previous bar.

MirTD
220
MirTD  
SDC:

when you say you set the shift value to 4 what do you mean by the shift ? Usually when we talk about the shift value we mean the bar shift; bar0, bar1, bar2 etc. Did you mean to say the buffer index value ?

If it is the buffer index you are talking about then of course it wont work when you set it to call buffer 4 on an indicator with only 3 buffers.

I may have misinterpreted your post but those two comments lead me to believe you may have some confusion with the last two parameters in iCustom(). The one before last is the buffer index, (called mode in the documentation) you would use that parameter to call one of your indicator buffers, probably 0,1 or 2 from your three buffer indicator. The last parameter is the bar shift, used to get the value from the buffer you nominated in the previous parameter, at the current bar or from a previous bar.

If it is the buffer index you are talking about then of course it wont work when you set it to call buffer 4 on an indicator with only 3 buffers.

yes, you are right.i meant to write mode but had written shift.actually I set the mode as 0,1,2 and 4,just to see what will be the results and got EA working(running) on mode value equal to 0,1 and 2 but not 4.whereas I want arraybuffer value of indicator buffer with setindexbuffer value equal to 0,but the EA seems to work fine even after

when I set indexbuffer value(mode) to 1 and then 2. is it like this?:for EA calling this kind of two color indicator in this fashion,mode value assigned to icustom makes no difference to EA getting the the correct value since the last two buffers depends on first buffer with setindexbuffer equals zero,to get its COLORS?

Ian Venner
2584
Ian Venner  

Buffer 0 would usually hold the current line value at every bar, regardless of the color.

buffer 1 would usually only hold the current line value when the line is buffer 1's color.

buffer 2 would usually only hold the current line value when the line is buffer 2's color.

Of course a lot depends on how the indicator is coded, sometimes I only use 2 buffers for a 2 color indicator. If you didnt code it yourself, you can verify if there is a main buffer and which one it is, and which are the color buffers by looking at the buffer values at each bar using the data window Ctrl D.

12
To add comments, please log in or register