Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set plot line value to EMPTY

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

    Set plot line value to EMPTY

    lets say, we want not to have the plot for specific bars.
    Generally, I was used to just "not plot" on that OnBarUpdate, like:

    Code:
    if (myCondition) 
      myPlot[0] = Close[0];
    so, if not `myCondition` then plot isn't being ploted/shown at all.

    but how can we use in ternary operator, like this?

    Code:
    myPlot[0] = myCondition ? Close[0] : Double.NaN;
    but on this case, it throws error (` Error on calling 'CalculateMinMax' method on bar XXX: The calculation results in unrenderable values.` )

    if i use
    Code:
    myPlot[0] = myCondition ? Close[0] : myPlot[1];
    then it plots at 0.00 on those occassions...
    what is workaround?
    yes, i know that i should not set value at all , or use .Reset(), but is there any value to assing to it, which will just force the chart not to shown line, as it is wasnt set at all on that bar?

    hope my question is simple.

    #2
    Hello TazoTodua, thanks for your post.

    Instead of setting the plot value to null for ignored data points, use Reset() and only plot if IsValidDataPoint() is true. Alternatively, if you are calculating values, and some of those values can be ignored, you can set the PlotBrushes of that bar to Brushes.Transparent to hide them while plotting.

    Best regards.
    Last edited by NinjaTrader_ChrisL; 08-24-2019, 02:50 PM. Reason: Changed BarBrushes to PlotBrushes

    Comment


      #3
      thanks.
      so, just with NULL value (or .nan) it is not possible to make that on that bar, to become ignored?

      I've not tried NULL, have tried double.nan, but it errors.

      thanks!

      Comment


        #4
        Hello TazoTodua, thanks for your reply.

        Sorry, in my last post I meant PlotBrushes, not BarBrushes.



        If you don't want to plot for some values, set the PlotBrushes[0][0] to Brushes.Transparent.

        Comment

        Latest Posts

        Collapse

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