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)
I am not astonished that it does not plot arrows. I am quite sure that it does not do any thing.
Here is the reason: OnBarUpdate() starts with the first bar on the chart, which is CurrentBar = 0. If you call Close[4] during the first run of OnBarUpdate(), you actually call the bar (-4), which unfortunately does not exist. Therefore the only thing that the indicator will generate is an error in your logfile.
Checking for Close[3] > Close[4] does only make sense, if the CurrentBar > 3. So you need to insert two additional lines in the beginning of OnBarUpdate()
Furthermore, your conditions are flawed. For example look at the condition set 1:
First line -> Close[0]<Close[1]
Third line -> ((Close[0] - Low[1]) + Close[0]) > ((Close[1] - Low[1]) + Close[1])
The third line condition is equivalent to Close[0] > Close[1], which in contradiction with the first line. This means that the condition set 1 will never take the value "true" and that the arrow will never be drawn...
In a similar way the condition set 2 is flawed:
First line -> Close[0]>Close[1]
Third line -> ((Close[0] - Low[1]) + Close[0]) > ((Close[1] - Low[1]) + Close[1])
Both conditions are identical, so the third line is redundant.