Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Data

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

    Bar Data

    I'm developing a DrawingTool.
    Scenario:
    Click on bar and draw an object at the High of that bar. I can print out the "startPoint" in GetSelectionPoints() and see the data. Do I need to convert to something in order to draw at the high of that bar?

    BTW, where is GetSelectionPoints() being called? I don't see it being called anywhere in the script, yet it works as intended.

    #2
    Hello funk101,

    First, I want to mention that NinjaTrader specific methods are triggered behind the scenes by the NinjaTrader core.

    For example, a bar closing triggers OnBarUpdate but you will not be able to see in the core code where this triggering takes place.
    OnRender is triggered anytime something changes the chart but you will not be able to see where this is triggered either in your script.

    The GetSelectionPoints() method is being triggered by event listeners that are part of the NinjaTrader core.


    If you are trying to draw in OnRender, you need x and y values. You can convert a price from a bar to a y value using chartScale.GetYByValue().

    Below is a link to the help guide on GetYByValue.
    http://ninjatrader.com/support/helpG...etybyvalue.htm

    I recommend you take a look at an indicator that draws using OnRender and also uses price data for calculations. For example the VolumeZones indicator would be good to look at.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I'm thinking that I would like for this to be a DrawingTool. It lends itself to this functionality. So, there is no way to get those values utilizing DrawingTool, PriceLevelContainer, etc? Must be, just don't know this well enough.

      Comment


        #4
        Hello funk101,

        Yes, you can get bar prices from a drawing tool.

        Take a look at the Regression Channel drawing tool.

        This drawing tool measures the prices of each bar and calculates the channel. Then those prices are converted to x and y values and the lines of the drawing tool are drawn using the x and y values.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        4 responses
        11 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by alifarahani, Today, 09:40 AM
        4 responses
        21 views
        0 likes
        Last Post alifarahani  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by PhillT, Today, 02:16 PM
        2 responses
        7 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by frankthearm, Yesterday, 09:08 AM
        14 responses
        47 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X