a[i] = a[i+1] + (condition ? value1 : value2);
?
You are looking for:
a[i] = a[i+1] + (condition ? value1 : value2);
?
Yes,
if close is higher than open, then
i summ to current close the previous "a".
This is the logic, but something i am having wrong
Thank you very much for your reply!!
Yes,
if close is higher than open, then
i summ to current close the previous "a".
This is the logic, but something i am having wrong
Thank you very much for your reply!!
if(c1>c2){ // An up candle b=a[i+1]; // previous value a[i]=b+c1; // what is the meaning of Close[x+1] + Close[x]? // E.g. Close[2]=1.5000 Close[1]= 1.5010 Close[0]=1.5020 a[0]=4.503 meaningless
Thank you very much for your reply WHRoeder. I read much about your post and you are very good programmer!!
Let me make it easy explanation. It is only for learn the behavior in mql4.
For example:
a[i+1] = 10
and each step i want to add 2 units :
a[i]=a[i+1]+2;
So, in the above code of first post:
If ( current close is higher than current open) then
b is equal to previous value of buffer "a"
Current value of buffer is equal to "b" plus current close.
I writte in this way because maybe i not explain correctly or there is any mystake in the logic.
This is for learn relationship between buffers, not make sense this code for any indicator.
Thank you very much. Some suggest can be very usefull.
- You aren't adding 2 to a buffer you are adding the close to the buffer then another close to the buffer...
- When prices are 1.5xxx adding 2 to it is meaningless.
- Forget your code, forget your buffers. Your logic is bogus.
Sorry, forget the code at this time,
if current value of buffer is equal to previous value of buffer plus one number(any number).
Can you put a example of this statement?
I am not searching to code a indicator. I search how can i relationship a previous value of one buffer with current value of same buffer.
Sorry for my wrong explanation.
Thank you for your reply!!
Hi,
any suggest??
thank you very much!!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
If for example, I want to add / subtract the value of the buffer prior Bar an amount according to a certain condition, how I relate to the previous buffer?
Thank you very much in advance,
I hope, i explained well the situation!!.
Any suggest is good for to lean