Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating a Point object. Relationship between SlotIndex, BarIndex, and Points

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

    Creating a Point object. Relationship between SlotIndex, BarIndex, and Points

    Hello,

    I'm trying to create a "Point" object (which takes X,Y coordinates), but all I have is a SlotIndex and a Price. So I need to convert these into X,Y values.

    I can't seem to find an example of this. I'm also unsure the difference between a SlotValue and a BarIndex.

    I see there is a "ConvertToHorizontalPixels" for double values, but this requires a "PresentationSource" as input. I'm not sure what that is.

    I'm sure it's easy and I'm missing it! Any help is greatly appreciated.

    #2
    chartControl.GetXByBarIndex(chartControl.BarsArray[0], SlotIndex);
    ref:http://ninjatrader.com/support/helpG...bybarindex.htm

    chartScale.GetYByValue(Price);
    ref:http://ninjatrader.com/support/helpG...etybyvalue.htm

    Code:
    Point myPoint = new Point(chartControl.GetXByBarIndex(chartControl.BarsArray[0], SlotIndex), chartScale.GetYByValue(Price));
    Last edited by Calonious; 10-21-2015, 12:57 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    24 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-25-2026, 09:53 PM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 03-25-2026, 09:51 PM
    0 responses
    18 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 03-23-2026, 11:13 AM
    0 responses
    27 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X