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 johnMoss, Today, 12:19 PM
    3 responses
    13 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by xepher101, 05-10-2024, 12:19 PM
    7 responses
    94 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by quicksandatl, 05-09-2024, 11:11 AM
    6 responses
    53 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by AlgoDreamer, Today, 10:39 AM
    4 responses
    22 views
    0 likes
    Last Post AlgoDreamer  
    Started by RamiRK86, 05-06-2024, 08:05 AM
    3 responses
    39 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X