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 bmartz, 03-12-2024, 06:12 AM
    3 responses
    27 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Aviram Y, Today, 05:29 AM
    2 responses
    8 views
    0 likes
    Last Post Aviram Y  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by TradeForge, Today, 02:09 AM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X