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

How to associate a price level with a SharpDX Y level?

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

    How to associate a price level with a SharpDX Y level?

    I've begun using SharpDX to plot text on a chart. One thing I can't figure out is how to plot to a particular price level on the chart. SharpDX deals in pixels, I believe. How is this conversion done?

    #2
    I found the answer:

    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
    int yLevel = chartScale.GetYByValue(17850); // Price level is 17850

    ....

    SharpDX.RectangleF rectangleF = new SharpDX.RectangleF(startPoint.X, yLevel, ChartPanel.W, ChartPanel.H);
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Irukandji, 05-06-2024, 03:06 PM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Kimberly  
    Started by RamiRK86, 05-06-2024, 08:05 AM
    2 responses
    31 views
    0 likes
    Last Post RamiRK86  
    Started by synthhokie, Today, 09:24 AM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by sofortune, Yesterday, 09:49 PM
    4 responses
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by phayes, Today, 09:13 AM
    2 responses
    25 views
    0 likes
    Last Post phayes
    by phayes
     
    Working...
    X