Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rectangle with prices as text in price axis

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

    Rectangle with prices as text in price axis

    Hi,

    I am developing an indicator for which I need to know the price in form of text in the right hand side price axis for e.g tops of bottoms of manually drawn rectangles or regions. Is there a way to do so ? Like by creating a new custom object that inherits from rectangle object? Do you have such code examples in c# ?

    Thanks in advance,

    Yoan​

    #2
    Hello z679Gju,

    When you say prices as text, do you mean prices in the form of a word like four?

    There is not a way to draw inside the price axis, you could draw to the left of the axis inside the chart with custom rendering. The only way to have text in the right side price axis is to format the price marker for a plot, you would plot a value and then use the FormatPriceMarker override to return text instead.

    Code:
    public override string FormatPriceMarker(double price)
    {
        return "SomeText";
    }

    Comment


      #3
      Thanks Jesse. I actually meant drawing the top value and bottom value of a rectangle like if the top is at 2.34$ and bottom at 2$, draw 2.34$ and 2$ in the price axis (left or right). Would your method be a good candidate for that?

      Comment


        #4
        Hello z679Gju,

        To draw anything in the right side axis it would have to be plotted data so if you wanted to draw a rectangle between two prices you would need two plots that represent those prices. Once the two plots are added a price marker is added on the right side. If you want the price marker to just display a price nothing else is required, if you wanted custom text you can use the override mentioned previously.

        Comment


          #5
          Thanks Jesse for your answer. In that case, I think I will try to just print text that matches top and bottom of all rectangles towards the right side but not on the price scale.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          155 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          90 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          137 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          130 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X