• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.

    https://ninjatrader.com/support/help...etvaluebyy.htm

    This should get you going in the right direction.

    Kind regards.
    Chris L.NinjaTrader Customer Service

    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:

        https://ninjatrader.com/support/help...toticksize.htm

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

        Best regards.
        Chris L.NinjaTrader Customer Service

        Comment


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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by madams212121, Today, 12:10 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by jvanelli, Today, 12:19 PM
          0 responses
          8 views
          0 likes
          Last Post jvanelli  
          Started by raaxus, Today, 11:17 AM
          2 responses
          13 views
          0 likes
          Last Post raaxus
          by raaxus
           
          Started by login_dejavu, Today, 02:22 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Leeroy_Jenkins, Yesterday, 09:17 AM
          1 response
          66 views
          0 likes
          Last Post NinjaTrader_Melissa  
          Working...
          X