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 ran into a problem when developing further SwingRays2 here on futures.io (formerly BMT). The problem: I need one indicator to make an Int value public. So I write SharingIndi, which has a private int and the value of this int is shown to the rest of the world.
Now I want to see whether those CurrBar values are really accesible from outside, so I write another indi.
and running both on the same chart reveals that Indi.CurrBar returns 0 all the time. Namely, the output is like
What am I doing wrong? Support does not help despite I have a live license...Attached are both indis.
Many thanks for any hint,
Daniel
Can you help answer these questions from other members on NexusFi?
I have imported this zip, and it appears to be working as expected on my end. Are you refreshing your output window? Otherwise the call is proper and the output is as expected.
You have an if statement in the SharingIndi which states to return(quit) if the CurrentBar < 5. You have 5 examples listed. What was the 6th bar output? With this statement intact, the first 5 bars will return 0 since it never gets to the currBar calculation and hence, any reference to the Indi.CurrBar will return 0 WHILE CurrentBar < 5.
Any time you reference something in one indicator from within another, the conditions set within that reference indicator have to be met before variables will be anything other than what they are set to during the Variable or Initialize region.
What you are seeing is the back-data on your data series "Days to load" being ran through the indicator. As these contain no real bar update calls they get fed through your indicator without meeting the CurrentBar rule.
Bottom line is, the information from the sharing indi is making it to the checker. You need to run live data through it to get the 0's to go away. I saw the same behavior on mine, but it cleared as soon as data was being fed in. Back data loaded into a chart is considered historical and is handled differently than live data by the OnBarUpdate method.