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

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.
    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:



        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 Tim-c, Today, 03:54 AM
          0 responses
          3 views
          0 likes
          Last Post Tim-c
          by Tim-c
           
          Started by FrancisMorro, Today, 03:24 AM
          0 responses
          2 views
          0 likes
          Last Post FrancisMorro  
          Started by Segwin, 05-07-2018, 02:15 PM
          10 responses
          1,770 views
          0 likes
          Last Post Leafcutter  
          Started by Rapine Heihei, 04-23-2024, 07:51 PM
          2 responses
          31 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by Shansen, 08-30-2019, 10:18 PM
          24 responses
          945 views
          0 likes
          Last Post spwizard  
          Working...
          X