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