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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      46 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      28 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      163 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      158 views
      2 likes
      Last Post CaptainJack  
      Working...
      X