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 Hwop38, 05-04-2026, 07:02 PM
          0 responses
          160 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          307 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          244 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          348 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          178 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X