NexusFi: Find Your Edge


Home Menu

 





Help Adding Data Series to Indicator


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one fiddlinground with 3 posts (0 thanks)
    2. looks_two bmaran with 2 posts (0 thanks)
    3. looks_3 sg72 with 2 posts (0 thanks)
    4. looks_4 r3torcr0 with 1 posts (0 thanks)
    1. trending_up 2,202 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 6 posts
    2. attach_file 3 attachments




 
Search this Thread

Help Adding Data Series to Indicator

  #1 (permalink)
 fiddlinground 
Salt Lake City Utah USA
 
Experience: Advanced
Platform: Ninjatrader
Trading: ES
Frequency: Daily
Duration: Hours
Posts: 21 since May 2018
Thanks Given: 1
Thanks Received: 1

Hi,

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

Attached Thumbnails
Click image for larger version

Name:	Screenshot (218).png
Views:	116
Size:	46.4 KB
ID:	323216  
Attached Files
Elite Membership required to download: FibonacciZones.zip
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
  #2 (permalink)
 sg72 
Orange County, CA, USA
 
Experience: Intermediate
Platform: NinjaTrader, Fidelity ATP
Trading: ES/NQ/RTY, Equity ETFs, Options
Posts: 59 since Sep 2018
Thanks Given: 44
Thanks Received: 48

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.

Good luck.

Reply With Quote
  #3 (permalink)
 r3torcr0 
Buffalo NY
 
Experience: Beginner
Platform: NinjaTrader
Trading: Forex
Posts: 23 since Sep 2013
Thanks Given: 7
Thanks Received: 23



fiddlinground View Post
Hi,

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

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.

Follow me on Twitter Reply With Quote
  #4 (permalink)
 fiddlinground 
Salt Lake City Utah USA
 
Experience: Advanced
Platform: Ninjatrader
Trading: ES
Frequency: Daily
Duration: Hours
Posts: 21 since May 2018
Thanks Given: 1
Thanks Received: 1


sg72 View Post
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.

Good luck.

Hi,

I tried adding the BarsArray[1] to the FibonacciST without success.

I was hoping someone else would do the edits for me to add this data series? It is a little above my coding experience.

thanks,
David

Started this thread Reply With Quote
  #5 (permalink)
 bmaran 
johns creek , GA, USA
 
Experience: Advanced
Platform: Ninja
Trading: gold
Frequency: Every few days
Duration: Minutes
Posts: 74 since May 2013
Thanks Given: 1
Thanks Received: 112


fiddlinground View Post
Hi,

I tried adding the BarsArray[1] to the FibonacciST without success.

I was hoping someone else would do the edits for me to add this data series? It is a little above my coding experience.

thanks,
David


Hi

I installed you indicator in Renko Bars using the BAR type you used.
But nothing is plotted.....

After installing the zip and adding indicator to chart the chart looks as below





Can you help to fix this

thanks

Reply With Quote
  #6 (permalink)
 fiddlinground 
Salt Lake City Utah USA
 
Experience: Advanced
Platform: Ninjatrader
Trading: ES
Frequency: Daily
Duration: Hours
Posts: 21 since May 2018
Thanks Given: 1
Thanks Received: 1


bmaran View Post
Hi

I installed you indicator in Renko Bars using the BAR type you used.
But nothing is plotted.....

After installing the zip and adding indicator to chart the chart looks as below





Can you help to fix this

thanks

That look's correct for the UniRenkoBen bars? Is that what you are trying to use?

Started this thread Reply With Quote
  #7 (permalink)
 bmaran 
johns creek , GA, USA
 
Experience: Advanced
Platform: Ninja
Trading: gold
Frequency: Every few days
Duration: Minutes
Posts: 74 since May 2013
Thanks Given: 1
Thanks Received: 112


fiddlinground View Post
That look's correct for the UniRenkoBen bars? Is that what you are trying to use?



I plotted renko chart as indicated by your diagram
Installed the indicator fib zones.

The added fib zone to the chart.

But I donot see anything plotted (Fib zones) in the charts


thanks
maran

Cam you give the renko bar settins.

I am using renko bars using your data series only. but for me np fib zones plotted

Reply With Quote




Last Updated on January 20, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts