Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Extract third-party indicator data.

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

    Extract third-party indicator data.

    public partial class Atrapados : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    {

    private mzFootprint MzFlow;
    private mzVolumeDelta MzDelta;

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Escriba la descripción de su nuevo Indicador personalizado aquí.";
    Name = "Atrapados";
    Calculate = Calculate.OnEachTick;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    }
    else if (State == State.Configure)
    {
    }
    else if (State == State.DataLoaded)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    //if (CurrentBars[0] < 1)
    // return;

    if (MzFlow != null && MzDelta != null)
    {
    double mzDeltaValue = MzDelta.__Volume[0];
    var mzFlowValue = MzFlow.AbsoprtionResistanceZoneSound[0];
    Print("MzFlow Value: " + mzFlowValue);
    Print("MzDelta Value: " + mzDeltaValue);
    }


    }​
    }​
    Could you help me extract the data, I get a call error in OnBarUpdate, reference to an object not established
    Last edited by franatas; 09-07-2023, 11:45 AM.

    #2
    Hello franatas,

    Thank you for your post.

    When working with third-party indicators, it is up to the developer to decide what is and is not exposed for use in other scripts. You should be able to access any public plots created in the script, but other values are not guaranteed to be available from other scripts. For more info on using 3rd party indicators:


    To determine which line of code is causing the error, you could add print statements every couple of lines of code and identify which print is the last to send to the NinjaScript Output window prior to the error. This could help to narrow down which value is coming back null (object reference not set to an instance of an object) and help you to debug/troubleshoot further. You could add checks for null references to help prevent this type of error, but as far as accessing the values from the third-party script you may need to reach out to the developer for more info on what values are and are not exposed. We have a page about checking for null references here::


    Thank you for using NinjaTrader.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    597 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X