Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        6 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        127 views
        1 like
        Last Post caryc123  
        Working...
        X