Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Decimal places of Crosshair tool

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

    Decimal places of Crosshair tool

    Hi,

    I have built a custom indicator that outputs integer values (counts something). The indicator plots integer values in a new panel. I need to use cross hair to analyze the integer value of my indicator. When I use cross hair, it displays the same integer value as a double value (up to two decimal places). For example, if my indicator plotted a value of 56 and I bring the cross hair over this value, it will show me 55.95 or 55.99 or 56.02 or 56.03. I need to simply see 55 or 56 or 57 (whole number as output by my indicator). Is there a way that I can change the cross hair to display only whole numbers and not to add any decimal places from its own? I have attached a screenshot that describes the problem I want to eliminate.

    Please advise me on this. Thanks for your guidance.


    #2
    Hello Mubeen Haider,

    You could use FormatPriceMarker for that purpose, there is a sample of displaying a specific number of decimal places for the marker in the following link. That would also affect the databox.



    I look forward to being of further assistance.

    Comment


      #3
      Hi Jesse,

      Thank you very much for your quick response. Actually, I'm already using the FormatPriceMarker() function. If you look at the screenshot I attached, the indicator values / the price marker in blue on right side Y-axis scale is not showing any decimal place because of the following part my code:

      public override string FormatPriceMarker(double price)
      { return price.ToString("N0"); }

      The problem is that crosshair marker is not following that. The crosshair remains with two decimal places as I shown in the screenshot. I want the crosshair to follow the whole/integer number format. The crosshair is showing two decimal places from its own. I need to change the crosshair behavior.

      Please advise me on that. Thanks for your guidance.



      Comment


        #4
        Hello Mubeen Haider,

        Thank you for the clarification.

        There is no way to change how the crosshair functions, the price listed would be from the mouse position and is locked to the instruments tick size.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        595 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        554 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X