Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

A hosted indicator tried to load additional data - AddIndicator to chart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A hosted indicator tried to load additional data - AddIndicator to chart

    Hi,

    I'm having an Error message "A hosted indicator tried to load additional data" when I add OrderFlowCumulativeDelta Indicator to strategy; How do I fix it?

    The code is as follows:

    Code:
    if (State == State.DataLoaded)
    			{
    				AddChartIndicator(OrderFlowCumulativeDelta(CumulativeDeltaType.BidAsk,CumulativeDeltaPeriod.Session,0));
    			}
    Code:
    protected override void OnBarUpdate()
    		{
    			if(CurrentBar <= 100) return;
    		}
    Attached is the full code.

    Thanks in advance.
    Attached Files

    #2
    Hello ricardo88,

    Thank you for your note.

    Because the OrderFlowCumulativeDelta adds a secondary tick series, your strategy would need to add this as well.

    You would have the following code in your strategy,

    else if (State == State.Configure)
    {
    Code:
    AddDataSeries("ES 06-18", BarsPeriodType.Tick, 1);
    }
    if (State == State.DataLoaded)
    {
    Code:
    AddChartIndicator(OrderFlowCumulativeDelta(CumulativeDeltaType.UpDownTick,CumulativeDeltaPeriod.Bar,0));
    }

    Please let us know if you need further assistance.
    Last edited by NinjaTrader_AlanP; 05-05-2018, 07:14 PM.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply AlanP, it worked as expected

      I'm trying to make AddDataSeries dynamic, I mean, OrderFlowCumulativeDelta load the instrument that I've selected in the chart instead of always loading the same instrument ("ES 06-18" with 610 tick bar).

      I'm trying with the next code but with no chance. I got the same Error: "A hosted indicator tried to load additional data..."

      Code:
      else if (State == State.Configure)
      			{
      				instrumento = this.Instrument.FullName.ToString();
      				periodo = BarsPeriods[0].Value;
      				AddDataSeries(instrumento,BarsPeriodType.Tick,periodo);
      			}
      Attached the full code. Thanks in advance.
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      6 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      6 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      167 views
      0 likes
      Last Post jeronymite  
      Started by cre8able, Today, 04:22 PM
      0 responses
      8 views
      0 likes
      Last Post cre8able  
      Started by RichStudent, Today, 04:21 PM
      0 responses
      5 views
      0 likes
      Last Post RichStudent  
      Working...
      X