BTW, you should call iCustom only once, in OnInit. (As far as this is MQL5)
You need to do this after you have calculated both buffers. You check if buffer2 is equal to empty value, if so, you copy the old value into the new place. - carry forward.
Instead of
else { Buffer1[i] = EMPTY_VALUE; }
Set this
else
{
Buffer1[i] = Buffer1[i + 1];
}
Dominik Christian Egert #:
BTW, you should call iCustom only once, in OnInit. (As far as this is MQL5)
You need to do this after you have calculated both buffers. You check if buffer2 is equal to empty value, if so, you copy the old value into the new place. - carry forward.
Instead of
Set this
Hi Dominik,
Thank you for your reply, I have tried that and the buy buffer is carried forward unless a sell buffer shows but goes back to the buyer immediately after the sell buffer.
What I'm trying achieve is to carry a buy forward until a sell buffer shows and then start carrying forward the sell buffer until the buy buffer shows. like a trend histogram for example.
Thanks again for the help, im still learning the ropes and appreciate your help.
Well, I would say, you need to maintain at least 3 states then. But it's probably easier to go with 5.
First state: no signal
Second/third state: buy/sell signal
Fourth/fifth state: carry forward.
Create yourself a table or a map in excel, and write down the conditions and dependencies.
Then you can code it.
Dominik Christian Egert #:
Well, I would say, you need to maintain at least 3 states then. But it's probably easier to go with 5.
First state: no signal
Second/third state: buy/sell signal
Fourth/fifth state: carry forward.
Create yourself a table or a map in excel, and write down the conditions and dependencies.
Then you can code it.
Thank you Dominik,
I will give it a shot

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi Guys
Hope you are well,
Im trying to make an indicator that uses histograms, at the moment it checks for a signal and draws a signal of one bar on histogram, how can i make it so its a continues histogram, so if a buy signal shows and the indicator draws a continuas blue histogram/buffer until a bearish signal comes then it starts making red histogram/buffer untill a buy signal and so on.
Many Thanks in advance