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)
Dear all
I would like to ask for help.
I have a "For loop"with for x =0 to 9 returning correctly 10 different numbers on each bar (confirmed by Print).
I need to pick up the highest number from these 10 numbers and do some further computing with it.
I have tried with Highest function and with Maxlist function, but so far failed.
Any help would be highly appreciated.
Thank you
Can you help answer these questions from other members on NexusFi?
the easiest will likely be to use a variable and compare during the loop if the current loop value is higher than the stored value in the variable. Make sure to remember resetting the variable each time before you enter the loop.
Something along the lines of this should do it:
At the end of this loop myTrackingVariable will hold the highest high of the last ten bars.
Thx ABCTG. I am afraid I still do something wrong, since getting only the last value in the loop. I have created code as an example and a screenshot to it. I simply would like to get at the end of the loop the highest Bar Range which occured during the looping.
Would be great if you could look where I am wrong.
Thank you
Sinuhet
you are welcome.
What's the purpose of using RangeX[x] in your loop instead of RangeX? The values can/will be different and from your code it appears you are looking for
This should give you the bar range within the bars you loop over.
By the way you can show your appreciation for posts on futures.io by clicking the "Thanks" button next to a post.