Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Convert TickSize to Pixels

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

    Convert TickSize to Pixels

    When Drawing lines in Panel1 , I use "n*TickSize " as on Offset from price to determine the "Y' value.

    When using this approach I get Lines that are closer or further away from price, as the Y scale Changes, or when the indicator is applied to a chart with a different TickSize.

    I could make things more consistent if I could place Lines by a Pixel Offset, say 6 pixels, from a price value. So if on a given chart, 1 Tick (TickSize) is equivalent to 12 pixels then to draw 6 pixels off Price I could use "6/12*TickSize" as the offset . Then, later on that chart, as price action changes a single Tick might be 30 pixels. Then in placing Lines I would use "6/30*TickSize" as the Offset in both cases placing lines at 6 pixels from price.

    ChartControl.Height will give # of pixels for the Entire Chart window. If I could get the # of pixels in just the pricePanel, and the Max&Min Prices displayed there then I could calculate the "pixels/Tick".

    Question:
    Can I do this?
    Is there another (better) way.

    #2
    This is currently not supported.
    RayNinjaTrader Customer Service

    Comment


      #3
      It might be possible to "capture" the min and max values by means of overriding the Plot(...) method. Check out the CustomPlotSample indicator.

      Comment


        #4
        It doesn't sound like a good practice to save values from the Plot method to be used in OnbarUpdate, as the values you're talking about are likely to rescale depending on the y-axis range of values, so my gut feeling is that this isn't always going to produce the desired effect.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        161 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        309 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X