Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Price Marker but not Plot

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

    Plot Price Marker but not Plot

    Hi,

    is there a way to plot a price marker on the chart, but without any (visible) plot?

    Basically I want to draw a short horizontal line and have the price marker at that level.

    I have tried setting plot pens to transparent, but the pricemarker then also becomes present.

    Could there be a way to set the pricemarker colour independently of the plot colour, or create some plot that has no visible line?

    Any suggestions welcome,

    thanks,
    Will.

    #2
    Hi Will unfortunately this would not be possible to separate the marker color from the plot. We have an enhancement suggestion in this regard in our trackings and I will make sure to note your request here as well. I would probably look into expressing the line over the plot directly so you would have the line and price marker as desired together. Another approach could be creating a custom marker via custom C# drawing in an overridden Plot method, you can review the Pivot indicator for examples into this (undocumented / supported) territory.

    Comment


      #3
      This can be easily done. All you need to do is to add an empty custom plot to your indicator. The price markers will be shown, but the plot will not plot anything.

      Here is the code to add in the end of your indicator:

      Code:
      #region Miscellaneous
      
      public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
      {
          if (Bars == null || ChartControl == null)
              return;
      }
      #endregion

      Comment


        #4
        Hi,

        could you explain better what you mean by " I would probably look into expressing the line over the plot directly so you would have the line and price marker as desired together"?

        Are you suggesting that I plot my line over the top of the chart plot? If so, how would I get my chart plot to be a single straight line of fixed length?

        Thanks,

        Comment


          #5
          Hi Harry thanks for the idea. The plot override works, but now I am having trouble drawing my line. Would I still just do that as I would normally, in OnBarUpdate() using DrawLine()?

          Thanks,

          Comment


            #6
            Thanks for the input Harry, this actually this is a better idea for dontpanic's scneario. As long as you also set a plot value for the marker and using the DrawLine in OBU() think it should be what you seek? Do you get any errors returned trying to draw the line now?

            Comment


              #7
              Hi Harry, got my line now, so that idea seems to do the trick,

              thanks!

              Comment


                #8
                Hi,

                I only have the skeleton of my indicator so far, I just wanted to test the ideas, but using Harry's suggestion I am setting pen colour and other attributes and also using Plot.set() to set the price marker value, and then I use Drawline() at my own value from within OnBarUpdate(), and so I have my price marker and my line now, and no plot, the way I want it.

                Thanks again,
                will.

                Comment

                Latest Posts

                Collapse

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