Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Retrieve Custom Bar Type Information

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

    Retrieve Custom Bar Type Information

    Hello,

    I have created a custom bar type. I would like to access this custom bar type's Open, High, Low, Close and Volume values. Can this be done? It should be doable as the values appear correctly in the Data Box. Can anyone suggest how this data can be retrieved via code? Any suggestions would be appreciated. Thank you.

    #2
    Hello Zeos6,

    Thanks for opening the thread.

    A BarType is a property of a data series. Using a different BarType will modify the series and its associated OHLC values. If you add an indicator to a chart with a Custom BarType applied and that indicator prints OHLC values, the OHLC values of that BarType will be printed.

    You would just have to access the associated PriceSeries as usual with the data series being one with a custom bartype. I.E. Open[0], High[0], Low[0], Close[0].

    If you have any additional questions, please don't hesitate to ask.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply Jim, but ...

      I do not think you reply is correct. Have you tried it with the Heikin Ashi bar type? If you access the Open, High, ... as you suggested, you get the underlying bar Open, High, ... rather than the haOpen, haClose, ... I'd like to retrieve the haOpen, haClose... Is this possible?

      EDIT:
      You are correct Jim but here is the confusion on my part. I put up a simple indicator on the Heiken Ashi bar type chart. It simple prints current bar index and high, low, ... values. The issue seems to be with what is going on at the start of the data period. The bar indices behave strangely relative to time stamps. I have attached a pic.
      Attached Files
      Last edited by Zeos6; 09-26-2017, 08:37 AM.

      Comment


        #4
        Hello Zeos6,

        I created a similar indicator and a video discussing the data I am seeing.

        Demo: https://www.screencast.com/t/0eubQYj8fu

        If you have any further questions, please include an example we can look at together and I will be happy to provide further input.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bmartz, 03-12-2024, 06:12 AM
        5 responses
        32 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        13 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        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
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X