Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator Not Plotting Values

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

    Indicator Not Plotting Values

    Hello support,

    I am having problems with a custom indicator. It does not plot anything, not even the constant lines.

    Code:
          Add(new Line(Color.FromKnownColor(KnownColor.Black), 0.0, "Zero"));
                Add(new Line(Color.FromKnownColor(KnownColor.Black), 0.5, "Half"));
                Add(new Line(Color.FromKnownColor(KnownColor.Black), 1.0, "One"));
                Add(new Line(Color.FromKnownColor(KnownColor.Black), 2.0, "Two"));
    despite the indicator range is 0.0 to 1.0 ( so there should be the Zero, Half and One lines). Also,

    Code:
         protected override void OnBarUpdate()
            {
    			double UD = UpDownTick.DeltaClose[0];
    			double UDTrades = UpDownTickTrades.DeltaClose[0];
    			
    			Print( UD + "/" + UDTrades );
    			TicksVolPerTicksTrades.Set( UD / UDTrades );
            }
    prints values to Output Window without any problems, but again, plotting does not happen. Please, what am I doing wrong?

    Regards,
    Daniel.

    #2
    Hello Eubie,

    Thank you for your post.

    I tested the Add()line methods you are using and have no issues.

    The Add lines should be added in the Initialize() method. However, Initialize() is only called when you first apply an indicator to a chart.

    If you are having issues, please try removing and re-adding this indicator to your chart. Also make sure you are adding this indicator to panel 2. You can set this in Initialize() by setting "Overlay = false".
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hello Matthew,

      herein is the whole code.

      Code:
      namespace NinjaTrader.Indicator
      {
          /// <summary>
          /// V tomto indikatoru zobrazujeme hodnoty UpDownTicks/UpDownTicksTrade. Idea je takova, ze pokud jdeme na short, chceme nejen oba Ticky rude, ale navic je potreba, aby to nebylo par velkych tradu, ale naopak hodne malych, ktere otoci trh.
          /// </summary>
          [Description("V tomto indikatoru zobrazujeme hodnoty UpDownTicks/UpDownTicksTrade. Idea je takova, ze pokud jdeme na short, chceme nejen oba Ticky rude, ale navic je potreba, aby to nebylo par velkych tradu, ale naopak hodne malych, ktere otoci trh.")]
          public class gomTicksVolPerTicksTrades : Indicator
          {
              #region Variables
              // Wizard generated variables
              // User defined variables (add any user defined variables below)
      		
      		private GomCD2 UpDownTick;
      		private GomCD3 UpDownTickTrades;
      
              #endregion
      
              /// <summary>
              /// This method is used to configure the indicator and is called once before any bar data is loaded.
              /// </summary>
       		protected override void OnStartUp()
      		{
      			UpDownTick 	= GomCD2( GomCDCalculationModeType.UpDownTickWithContinuation, GomCDChartType.NonCumulativeChart, true);
      			UpDownTickTrades = GomCD3( GomCDCalculationModeType.UpDownTickWithContinuationTrades, GomCDChartType.NonCumulativeChart, true);
      		}
      
              protected override void Initialize()
              {
                  Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "TicksVolPerTicksTrades"));
                  Add(new Line(Color.FromKnownColor(KnownColor.Black), 0.0, "Zero"));
                  Add(new Line(Color.FromKnownColor(KnownColor.Black), 0.5, "Half"));
                  Add(new Line(Color.FromKnownColor(KnownColor.Black), 1.0, "One"));
                  Add(new Line(Color.FromKnownColor(KnownColor.Black), 2.0, "Two"));
                  Overlay				= false;
              }
      
              /// <summary>
              /// Called on each bar update event (incoming tick)
              /// </summary>
              protected override void OnBarUpdate()
              {
      			double UD = UpDownTick.DeltaClose[0];
      			double UDTrades = UpDownTickTrades.DeltaClose[0];
      			
      			Print( UD + "/" + UDTrades );
      			TicksVolPerTicksTrades.Set( UD / UDTrades );
              }
      So everything seems OK. A tried readding, I tried turning Ninja off and on again... Is there a limit for number of panels on a chart? This is my 9th one...

      Thank you,
      Daniel.

      Comment


        #4
        Probably got it. I reran the replay and the first values showed. Then a bar with a value of 0/0 to plot appeared and all of a sudden the whole indicator plot disappeared.

        Thanks for your kindness.

        Comment

        Latest Posts

        Collapse

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