Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Information numbers above the candle

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

    Information numbers above the candle

    Good afternoon, I just want something that I think is very simple but I don't know how to do it.
    When the candle is bullish, that is correct, the number appears at the bottom, but I also want it to appear at the top when the candle is bearish.
    I send you the code and also the image.
    Thank you very much in advance.​..

    if (Instrument.MasterInstrument.Name == "MNQ")
    if (Close[0] > Open[0]) // candle is an up 'green' bar

    {
    _barCntr = ((High[0] - Low[0]) / TickSize) /2;
    Draw.Text(this, CurrentBar.ToString(), true, _barCntr.ToString("C"), 0, _textYStartingPoint, _pixelsAboveBelowBar, _textColorDefinedbyUser, myFont, TextAlignment.Center, null, null, 1);
    }
    else
    _barCntr = ((High[0] - Low[0]) / TickSize) /2;
    Draw.Text(this, CurrentBar.ToString(), true, _barCntr.ToString("C"), 0, _textYStartingPoint, _pixelsAboveBelowBar, _textColorDefinedbyUser, myFont, TextAlignment.Center, null, null, 1);




    Attached Files
    Last edited by punkiy2111; 06-26-2024, 10:28 AM.

    #2
    Hello punkiy2111,

    To do that you would need to change the price being used when you draw the text. From the given code you are using the center of the bar and then y offset to control positioning. If the text needs to be above the bar you would have to adjust the y positioning variable to match what you need in that condition.

    Comment


      #3
      Thank you but I don't fully understand, would you be so kind as to write me the example code? I think it's something very basic but I don't understand programming, I'm just asking you for a line, thank you very much.

      Comment


        #4
        Hello punkiy2111,

        A drawing object is positioned by the price you use and secondary positioned using an amount of pixels offset from the price. The code you have already works you would just need to adjust how you are calculating the offset in your script. That part was not included so I couldn't make a specific recommendation but you likely need to specify the offset for the text object inside of your conditions where you draw the objects. Depending on the direction you could change the offset to place the object where you wanted.

        Comment


          #5
          Hello Sir juste explain to me what you want to plot in text and i can help you solve this issues
          thanks

          Comment


            #6
            Thank you very much for responding. What I need is for the path information to appear in dollars as I put in the example, but what I want is for it to appear above in the bearish candles. Now everything is fine but I always get this information below the candle. The only thing I want is for this information to appear above in the bearish candles. Thank you.

            Comment

            Latest Posts

            Collapse

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