Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator not plot

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

    Indicator not plot

    Hi I have some issues with new idicator creation. Everytime when I asign a mathematical formula other then "+" or "-" indicator does not plotting on the chart.

    Where is the problem? Can somebody Help?

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Navy), PlotStyle.Line, "Plot0"));
    CalculateOnBarClose = true;
    Overlay = false;
    PriceTypeSupported = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    Plot0.Set((High[0]+ Low[0])/(High[0]-Close[0]));
    }

    #2
    Originally posted by serman View Post
    Hi I have some issues with new idicator creation. Everytime when I asign a mathematical formula other then "+" or "-" indicator does not plotting on the chart.

    Where is the problem? Can somebody Help?

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Navy), PlotStyle.Line, "Plot0"));
    CalculateOnBarClose = true;
    Overlay = false;
    PriceTypeSupported = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    Plot0.Set((High[0]+ Low[0])/(High[0]-Close[0]));
    }
    serman,

    Recheck your math...

    Your numerator is double the price.

    your denomiator is a very small points difference number.

    For ES, 2000 points/ .5 point high - low = 4000 point plot.

    For ES, 2000 points/ .2 point high - low = 10000 point plot.

    For ES, 2000 points/ 2 point high - low = 1000 point plot.

    RJay
    RJay
    NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

    Comment


      #3
      serman, it is always a good idea to check the logs for errors (right-most tab in Control Center). I copied + pasted your code and it gave me an overflow error, which would explain why it doesn't plot. rt6176 has provided some insight to this situation.

      Another problem could be division by 0 if the high and close are the same price. This would give you another error.
      AustinNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      581 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      338 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
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X