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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    145 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X