Then you have not coded what you have outlined above
Show your code and somebody may be able to help you

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
I've been trying to establish the cross above or below zero, on an indicator. I am comparing the value of Bar #2 to Bar #1. Not Bar #0. If Bar#2 < 0 and Bar#1 > 0 then cross up. If Bar#2 > 0 and Bar#1 < 0 then cross down. Should be simple. If below 0, number is negative. If above, positive. My problem is, that when both Bars are negative, the code ignores their state and which ever Bar is larger determines cross up and cross down. Same condition occurs with both Bars, positive. How would I code this so that I only consider one Bar positive and one Bar negative to determine cross up or cross down, and ignore cases where there is two Bars positive or two Bars negative?
Thanks!