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'm trying to code a way of determining the lowest bar over a series of bars and if there are more than one bar with the same low, to choose the bar with the largest range.
I thought of using "lowestbar" function but that would only give me the most recent low and would ignore the earlier bars with similar lows.
Any thoughts and ideas?
Regards
Kay Wai
Can you help answer these questions from other members on NexusFi?
You cannot use the LowestBar method, as it does not take into account the second condition, you need to code this manually.
Just loop through the lows of the last n bars. If you find a lower low, store the index of the bar with the lower low. If you find a low identical to the previous lowest low compare the range of this bar with the range of the bar that belongs to the stored index. Now if the new bar has a larger range than the bar with the identical low, then store the index of the new bar, otherwise do not store it and continue the loop.