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 Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      3 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,772 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X