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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      46 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      141 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      160 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      96 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      275 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X