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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X