Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Map Y location to Price

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

    Map Y location to Price

    Hi-

    I need to workout the nearest price from the Y location of the mouse. I have the Y location sorted, but I am unsure how to map the location to a price. ChartPanel doesnt seem to have any capabilities for this.

    Any advice?

    Thanks,

    Nick.

    #2
    Hello ptpatrader, thanks for your post.

    There exists the GetValueByY method that you can use given you have the Y coordinate of the mouse.



    This should get you going in the right direction.

    Kind regards.

    Comment


      #3
      Thanks Chris-

      Is there an easy way to map this returned value to the closest tick? I seem to remember seeing some code somewhere but not sure where.

      Thanks,

      Nick.

      Comment


        #4
        Hello Nick, thanks for your reply.

        There is the RoundToTickSize() method that will round a price to the master instruments nearest tick size:



        You could also do this manually using the TickSize property, that will return the tick size of the master instrument.

        Best regards.

        Comment


          #5
          Apologies Chris, I missed this. This works, thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          44 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          58 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          35 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          95 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          59 views
          0 likes
          Last Post PaulMohn  
          Working...
          X