Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change Plot Style in OnBarUpdate?

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

    Change Plot Style in OnBarUpdate?

    I'm guessing that it is not possible to change the plot syle outside of State.SetDefaults?
    I know I can change the plot brushes with PlotBrushes[X][X] = Brushes.XXXX;
    It would be awesome if I could do the same with the plot style.

    #2
    Hello AssIsChubby,

    Thank you for your post.

    It's possible to change the Plot Style in OnBarUpdate:

    Code:
    public class OBUPlotStyleChangeTest : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "OBUPlotStyleChangeTest";
    Calculate = Calculate.OnBarClose;
    IsOverlay = true;
    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;
    AddPlot(Brushes.Orange, "TestPlot");
    }
    else if (State == State.Configure)
    {
    }
    }
    
    protected override void OnBarUpdate()
    {
    Plots[0].PlotStyle = PlotStyle.Dot;
    
    Value[0] = Close[0];
    }
    
    #region Properties
    
    [Browsable(false)]
    [XmlIgnore]
    public Series<double> TestPlot
    {
    get { return Values[0]; }
    }
    #endregion
    
    }
    That example will change the plot style to Dot instead of a line.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Sweet! Thank you Kate!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      43 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      47 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X