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 nuobo, Today, 07:43 PM
    0 responses
    1 view
    0 likes
    Last Post nuobo
    by nuobo
     
    Started by ETFVoyageur, Today, 02:04 PM
    3 responses
    21 views
    0 likes
    Last Post ETFVoyageur  
    Started by cre8able, Today, 06:18 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Started by ETFVoyageur, Today, 06:05 PM
    0 responses
    7 views
    0 likes
    Last Post ETFVoyageur  
    Started by TAJTrades, 04-28-2024, 09:46 AM
    2 responses
    18 views
    0 likes
    Last Post TAJTrades  
    Working...
    X