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 have been using this NinjaTrader 8 indicator on a Renko Chart, since Renko is not time based, it gives a more accurate Fibonacci Retracement on swings. I would like to use the same indicator on a tick chart by adding the same Renko Data Series on the indicator.
I have already added the Renko Data Series to the indicator and it compiles fine. I'm not sure how/where to add the (BarsArray[1] to the plot to get the indicator to work off the Renko Data Series on a tick chart? I was hoping someone would help me to make the data series work on this indicator?
thanks,
David
Can you help answer these questions from other members on NexusFi?
Sorry about the last deleted post. I accidentally submitted before I was done and deleted it. Here's the complete response.
I believe this is what you need to do at least to get started, but (disclaimer) my answer is merely based on glancing at your code. I didn't actually do these steps and test that they work.
As you start tweaking, it may become apparent that you need other changes. So take these suggestions as starting points and not the exact changes you need to make. You'll need to do your own due diligence to get to a complete solution.
In State.Configure, you have two instances of your class FibonacciST. You need to replace "this" with "BarsArray[1] so it operates on the secondary series.
Also, in a multi-series script, under OnBarUpdate, you need to be aware of which BarsInProgress you are operating on. I would recommend looking at the Ninja help guide for details, but you usually need something like this.
if( BarsInProgress == 0 )
{
// Do something with primary series -- BarsArray[0]
}
if( BarsInProgress == 1 )
{
// Do something with secondary series -- BarsArray[1]
// This is where you need to do your processing
}
Also be aware that things like CurrentBar, Open[], High[], Low[], Close[], etc change meaning depending on which BarsInProgress you are in.
In BIP0, they point to CurrentBars[0], Opens[0][], Highs[0][], etc.
In BIP1, they point to CurrentBars[1], Opens[1][], Highs[1][], etc.
I didn't notice this in your code, but if you need to create additional custom series to hold intermediate data for processing your logic based on BarsArray[1], you have to make sure that those custom series have the same number of elements as the series you're working with (ie; BarsARray[1]). This is generally done in State.DataLoaded.
I hope this gives you enough to get started on.
If you have other specific questions, I'll be happy to answer if I know the answer.
In OnBarUpdate() , add if (BarsInProgress == 0) {... around you current code then add if (BarsInProgress == 1) {} to handle the logic for the new data series.
Since your plots will most likely be for Series 0, you may have to set variables for series 1 then use them to plot whatever you wish when processing series 0.