use the code button (Alt+S) when pasting code
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Of course, it doesn't; why does that surprise you? 1) n has no value, so you are reading a random bar. 2) you have no loop; all you get is a random result.
MT4: Learn to code it.
MT5: Begin learning to code it.
If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
or pay (Freelance) someone to code it. Top of every page is the link Code Base.
Hiring to write script - General - MQL5 programming forum 2019.08.21
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I need a MT4 indicator that counts up/down bars and pips for a certain period.
Additionally if it is possible, in a small window to count the same on any timeframes.
For Instance:
EUR/USD 1M Up Bars 432/Down Bars 522 Up pips 6663/Down pips 3342
EUR/USD 5M ......................
etc
I tried this code but it doesn't count correctly.