Hello,
I believe I am fairly competent in coding expert advisors but coding technical indicators seem to be a whole another challenge. I have attached my code below, if anyone could point me in the right direction I would be grateful. Why isn't my custom indicator showing when I apply it to the symbol chart?
This logic makes no sense:
for(int i = Bars-1; i >= IndicatorPeriod;i++)
Bars is a huge number, like 10000 or even more.. is the total number of bars which displays on the chart window..
lets consider bars is 10000. For i =9999, loop the for function, increasing i by 1, until i is greater than 14.
i is being initialized as 9999, which already is greater than 14
Nothing will be done at all.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
-
#property indicator_buffers 1 #property indicator_plots 1
MT4 does not have indicator_plots.
-
double Velocity = (open[5]-close[5]/2);
You are drawing a straight line. You have not set which direction (as-series/non-series) you are accessing the arrays.
-
for(int i = Bars-1; i >= IndicatorPeriod;i++){
See How to do your lookbacks correctly #9 … #14 & #19.
-
MT4 does not have indicator_plots.
-
You are drawing a straight line. You have not set which direction (as-series/non-series) you are accessing the arrays.
-
See How to do your lookbacks correctly #9 … #14 & #19.
I see, I've looked at the documentation but I cannot understand it, can you clarify how I'd code this please?
This logic makes no sense:
Bars is a huge number, like 10000 or even more.. is the total number of bars which displays on the chart window..
lets consider bars is 10000. For i =9999, loop the for function, increasing i by 1, until i is greater than 14.
i is being initialized as 9999, which already is greater than 14
Nothing will be done at all.
So should I do it as
for(int i = Open[0]; i >= IndicatorPeriod;i++)
A price is not an int.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I believe I am fairly competent in coding expert advisors but coding technical indicators seem to be a whole another challenge. I have attached my code below, if anyone could point me in the right direction I would be grateful. Why isn't my custom indicator showing when I apply it to the symbol chart?