Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
you evaluate your condition at 1200. At that time your code assigns the value of the reserved word High to your variable HP i.e. HP = High and thus your check for High > HP can never be true at 1200.
Without knowing what exactly you want to check for it's hard to point you into the right direction, but maybe you can elaborate a bit more on the exact condition you want to check for.
I am trying to assign a 1 if anytime after 1200 if the high of 1200 bar is exceeded by .01 points ( 1 tick) or a -1 if the low of the 1200 bar is exceeded by .01 points or 1 tick.
you evaluate you conditions within a if ... then begin ... end conditional branch i.e. only if Time = 1200 and since you assign High to HP at 1200 and perform your check at 1200 only, your condition High +.01 > HP will always be true.
Depending on the instrument you apply this to you might not need the additional +/-1 0.01, but to achieve what you have in mind the checks need to be moved out of the if Time = 1200 block. Otherwise they won't be evaluated every bar.