NexusFi: Find Your Edge


Home Menu

 





About : All data must first be loaded by the hosting NinjaScript in its configure sta


Discussion in NinjaTrader

Updated
    1. trending_up 1,806 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 10 posts
    2. attach_file 1 attachments




 
Search this Thread

About : All data must first be loaded by the hosting NinjaScript in its configure sta

  #1 (permalink)
bicou
Paris france
 
Posts: 13 since Mar 2023
Thanks Given: 0
Thanks Received: 1

Hello,

I have a chart in NinzaRenko (https://tradersdevgroup.supporthero.io/article/show/109113-download-the-ninzarenko)

I am trying to develop an indicator in which I use another indicator ( (https://tradedevils-indicators.com/collections/frontpage/products/[AUTOLINK]orderflow[/AUTOLINK]-buy-sell-momentum).

The problem is that my code does not work with the error message 'TDU Buy/Sell Momentum' tried to load additional data. All data must first be loaded by the host NinjaScript in its configuration state. Attempted to load ZN 06-23 Globex: 1 Tick
even though I have in my code

 
Code
protected override void OnStateChange()
{
.......

else if (State == State.Configure)
	{
	        AddDataSeries(new BarsPeriod() {
	        BarsPeriodType = (BarsPeriodType)12345,
		Value= 10,
		Value2= 10
		}) ;   
	}
Could you please help me ?
I dont know what means "Globex: 1 Tick"
I specify that I am in "Simulated data feed"

Thank you for all your advice

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Are there any eval firms that allow you to sink to your …
Traders Hideout
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - April 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
  #2 (permalink)
 Rainmakersg 
Singapore Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 31 since May 2020
Thanks Given: 62
Thanks Received: 41

I ran into the same problem and after reading the NT8 forum and documentation, I resolved it by doing the following:


My "sending" Indicator has AddDataSeries( xxx) under "else if (State == State.Configure)":

else if (State == State.Configure)
{
AddDataSeries(xxx);
}


What I did was just copy the AddDataSeries( xxx) and pasted under the "else if (State == State.Configure)" of my "receiving" indicator/strategy.



bicou View Post
Hello,

I have a chart in NinzaRenko (https://tradersdevgroup.supporthero.io/article/show/109113-download-the-ninzarenko)

I am trying to develop an indicator in which I use another indicator ( (https://tradedevils-indicators.com/collections/frontpage/products/[AUTOLINK]orderflow[/AUTOLINK]-buy-sell-momentum).

The problem is that my code does not work with the error message 'TDU Buy/Sell Momentum' tried to load additional data. All data must first be loaded by the host NinjaScript in its configuration state. Attempted to load ZN 06-23 Globex: 1 Tick
even though I have in my code

 
Code
protected override void OnStateChange()
{
.......

else if (State == State.Configure)
	{
	        AddDataSeries(new BarsPeriod() {
	        BarsPeriodType = (BarsPeriodType)12345,
		Value= 10,
		Value2= 10
		}) ;   
	}
Could you please help me ?
I dont know what means "Globex: 1 Tick"
I specify that I am in "Simulated data feed"

Thank you for all your advice


Reply With Quote
  #3 (permalink)
bicou
Paris france
 
Posts: 13 since Mar 2023
Thanks Given: 0
Thanks Received: 1


Thank you for this answer.
The problem is that it is a commercial indicator and that put on the chart it works very well without using AddDataSeries()... and that anyway, I do not have access to its code...

Reply With Quote
  #4 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 73 since Jan 2020
Thanks Given: 23
Thanks Received: 42


bicou View Post
Thank you for this answer.
The problem is that it is a commercial indicator and that put on the chart it works very well without using AddDataSeries()... and that anyway, I do not have access to its code...

I suggest you first try with a less "exotic" bar type. Try something like regular minute or day bars. Let that be loaded by your sending indicator.

In OnBarUpdate(), try calling the commercial indicator by sending it NOT the primary dataseries on the chart, but rather the added DataSeries.

For example, if I were to call the SMA indicator but ask it to process the day bars, i'd try something like:

double MyValue = SMA(BarsArray[1], 50)[0];

Your commercial indicator is most probably based on the generic Indicator class, and as such it should support TWO different ways of being called: either with the primary bar series on the chart, or one of the additional DataSeries.

In the SMA case, let's say you want to take a 15-bar SMA. You either do:

SMA(15) // which calls SMA and sends it the primary data series on the chart, i.e. BarsArray[0]

or
SMA(BarsArray[1], 15) // which asks the SMA indicator to work with the first additional data series

And if you had two additional DataSeries, you would do:
SMA(BarsArray[2], 15)

So just to expriment, try loading a more conventional DataSeries first, then call your commercial indicator by sending to it the BarsArray[1]

Also remember to put in some condition in OnBarUpdate to have the indicator react to only the DataSeries you want to target. For example:

if (BarsInProgress != 1) return; //this would ignore incoming ticks related to the additional DataSeries (i.e. BarsArray[1]) and only process bars related to the primary series.

See if this helps.

Reply With Quote
  #5 (permalink)
bicou
Paris france
 
Posts: 13 since Mar 2023
Thanks Given: 0
Thanks Received: 1

Thank you for your answer but I tried before with bars in Minutes but I have the same problem and I do not see how to apply this way of calling the indicator to this particular indicator.
The only error in my code (probably due to a bad copy/paste) is the Id of the type of Bar which is 12345 and not 14

Reply With Quote
  #6 (permalink)
 Rainmakersg 
Singapore Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 31 since May 2020
Thanks Given: 62
Thanks Received: 41


bicou View Post
Thank you for this answer.
The problem is that it is a commercial indicator and that put on the chart it works very well without using AddDataSeries()... and that anyway, I do not have access to its code...


This is what I think.

The ninZaRenko is a custom bar type and its documentation says its ID is 12345.

NT8's AddDataSeries documentation is as follow:
https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?adddataseries.htm

For custom bar types, scroll to the green section "tips" and see point 2.

Looking at your code, you seem to have done the correct thing in your code.

Maybe you can double confirm the ID using a Ninjatrader-built indicator to help identify the correct enum value of the custom bar. You can download it here:
https://ninjatraderecosystem.com/user-app-share-download/bars-type-identifier/

When you run the indicator, open your Output window to see the ID of your custom indicator. Se if it is indeed 12345.

If the ID is indeed 12345, maybe you can troubleshoot by trying out a regular NT8 built-in renko bar type and apply to your current code. If it doesnt work, then it is a systematic problem that you need to address. If it works, then it has to do with the ninZaRenko. You may need to contact the developer. There is a free and paid version. If it is the paid version, I am sure they will answer you.



Hope it helps.

Reply With Quote
  #7 (permalink)
bicou
Paris france
 
Posts: 13 since Mar 2023
Thanks Given: 0
Thanks Received: 1

Thank you for all your help
My Id is correct as you can see on the attached image (an adaptation of the barsidentifier indicator because I don't know how/where to find the "output" display)
As for the rest, everything seems to be correct too, so I really don't understand...


Reply With Quote
  #8 (permalink)
 Rainmakersg 
Singapore Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 31 since May 2020
Thanks Given: 62
Thanks Received: 41


bicou View Post
Thank you for all your help
My Id is correct as you can see on the attached image (an adaptation of the barsidentifier indicator because I don't know how/where to find the "output" display)
As for the rest, everything seems to be correct too, so I really don't understand...


Then have you tried the regular Renko bar type?
I see that you also have UniRenko.

Maybe you can replace all NinZaRenko with Renko and see if your receiving indicator can read from the hosting indicator. Then repeat with replacing UniRenko.

Hopefully can help you narrow down the cause.

Reply With Quote
  #9 (permalink)
bicou
Paris france
 
Posts: 13 since Mar 2023
Thanks Given: 0
Thanks Received: 1

Thank you for your answer.
My problem is that whatever the type of bar chosen I always have the same error at execution
So I thought about it and I'm not sure if the problem comes from this line
 
Code
TDUBuySellMomentum1	= TDUBuySellMomentum(Close, NinjaTrader.Data.BarsPeriodType.Second, 15, 15, 2, TDUBuySellMomentumDisplayType.CandleOutline, 10, 60, 400, 4);
with the type of bar but I don't know how to change it properly here because I can't find an example.
But this line is the basic configuration of the indicator which works perfectly when added to a chart, whatever the chart type is...

Reply With Quote
  #10 (permalink)
 Rainmakersg 
Singapore Singapore
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 31 since May 2020
Thanks Given: 62
Thanks Received: 41



bicou View Post
Thank you for your answer.
My problem is that whatever the type of bar chosen I always have the same error at execution
So I thought about it and I'm not sure if the problem comes from this line
 
Code
TDUBuySellMomentum1	= TDUBuySellMomentum(Close, NinjaTrader.Data.BarsPeriodType.Second, 15, 15, 2, TDUBuySellMomentumDisplayType.CandleOutline, 10, 60, 400, 4);
with the type of bar but I don't know how to change it properly here because I can't find an example.
But this line is the basic configuration of the indicator which works perfectly when added to a chart, whatever the chart type is...

I already see that you have previously asked the same question in NT8 forum:
https://forum.ninjatrader.com/forum/ninjatrader-8/indicator-development/1242597-error-tried-to-load-additional-data

Both the vendor of the indicator and NT8 have already answered your question. You should first try to successfully load the 15 second chart before loading other bar types. I suggest you ask the vendor directly for a template.

Reply With Quote




Last Updated on April 3, 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