Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Letters automatically adjusted to screen

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

    Letters automatically adjusted to screen

    I have created a proprietary Market Profile indicator and I would like to adjust the letters size AUTOMATICALLY to the screen display as we play with x and y axis shrinking or enlarging the chart.

    Is there a conventional way to do this in code ?


    Thank you

    #2
    Hello blar58,

    Thanks for your inquiry.

    You could use a variable for your font size and then use ChartScale.Height and ChartScale.Width to create ratios to scale your font size.

    I would recommend comparing the difference between MinValue and MaxValue (MaxMinusMin) with ChartScale.Height to scale on the Y-axis, and to compare how many bars are visible on the chart to ChartScale.Width for the X-axis.

    The number of bars visiable on a chart can be found by looping through ChartBars.FromIndex to ChartBars.ToIndex.

    Documentation on the items discussed can be found below.


    Please let me know if I can be of further assistance.

    Comment


      #3
      I have a difficult time figuring out how to calculate that ratio to apply the right font size

      When the Y axis is small and X axis is large I don't know how a font size would be able to fit the space.

      Comment


        #4
        Hello blar58,

        Using both the Y and X axis would be difficult for font size for that reason. It is my opinion that it would be easier to leave font size to the Y axis and to use the X axis for how many characters are visible with your text.

        One idea I can think of for your main goal would be to check if both the Y axis and the X axis are within an acceptable range to allow increasing the font size. One will have to be the minimum.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        573 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X