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 tkaboris, Today, 05:13 PM
    0 responses
    2 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Working...
    X