Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Conditional PlotBrush Color and Size

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

    Conditional PlotBrush Color and Size

    Hi,

    I am struggling with getting my indicator to plot in a sub panel a small dot when the code doesn't meet the criteria and then if either of the two conditional statements is true, I would like it to enlarge only the dot that meets either of the two criteria. The dots color correctly, however, they all either go small or large in all previous bars.

    Please consider the following script:

    Plots[0].Width = 1;
    PlotBrushes[0][0] = Brushes.DimGray;

    if (Value[0] > .92 && Trend1 > (Trend2 - 6*TickSize))
    {
    Plots[0].Width = 3;
    PlotBrushes[0][0] = Brushes.LimeGreen;
    }
    if (Value[0] < .08 && Trend1 < (Trend2 + 6*TickSize))
    {
    Plots[0].Width = 3;
    PlotBrushes[0][0] = Brushes.Fuchsia;
    }

    Thanks in advance for your help.​

    #2
    Hello zoom zoom 126,

    Thank you for your post.

    Unfortunately, there are no documented or supported means for changing the width of a segment of a plot. The width can be set for the entire plot, however, not for a specific section of the plot.

    That said, this thread will be open for other community members to share their insight on possible undocumented ways to accomplish this.

    Please let us know if you have any further questions. ​

    Comment


      #3
      Originally posted by zoom zoom 126 View Post
      Hi,

      I am struggling with getting my indicator to plot in a sub panel a small dot when the code doesn't meet the criteria and then if either of the two conditional statements is true, I would like it to enlarge only the dot that meets either of the two criteria. The dots color correctly, however, they all either go small or large in all previous bars.

      Please consider the following script:

      Plots[0].Width = 1;
      PlotBrushes[0][0] = Brushes.DimGray;

      if (Value[0] > .92 && Trend1 > (Trend2 - 6*TickSize))
      {
      Plots[0].Width = 3;
      PlotBrushes[0][0] = Brushes.LimeGreen;
      }
      if (Value[0] < .08 && Trend1 < (Trend2 + 6*TickSize))
      {
      Plots[0].Width = 3;
      PlotBrushes[0][0] = Brushes.Fuchsia;
      }

      Thanks in advance for your help.​
      You can not change the plot width. But you can use the same criteria to just change the color of the plot. You can also use Draw tools to draw an arrow or a dot, etc. when Plot[0] crosses the 0.92 or 0.08 lines with the colors that mactch your criteria for visual or as a buy sell / signal.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      128 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      73 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      116 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      109 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      88 views
      0 likes
      Last Post CarlTrading  
      Working...
      X