IITJV: I know that I cannot put [n] behind BarDir.
Since you are computing bar n, you must. Make BarDir a buffer.
double BarRange = High[n] - Low[n];

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
It is called Bar Direction. My idea is that if the current bar has C higher than Midpoint, it will be equal to 1 and vice versa. But if that bar is a perfect Doji (C = O and C = Midpoint), it will be equal to Direction of the Previous Bar. That's when the problem arose and I don't know how to solve it.
I know that I cannot put [n] behind BarDir. I just want to show that I want it to work like that so...
Can you guys show me the way to make it work?
Thank you in advance!