Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bar types

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

    Custom Bar types

    Hi,

    I am trying to understand how to go about making my own volumetric type bars. I've been reading through the BarsType/ChartType pages and I don't see how I can create a bar type that contains data points besides OHLC & Volume. Is this possible? Is there documentation or a sample somewhere I can look at to see this in action?

    (For instance, if I am trying to display the order flow imbalances per price level).

    #2
    Hello, thanks for writing in. The bid and ask information is provided in the OnDataPoint parameters:
    protected override void OnDataPoint(Bars bars, double open, double high, double low, double close, DateTime time, long volume, bool isBar, double bid, double ask)

    The OrderFlow+ tools are not open source, so I am not able to provide any insight on how they function internally (I have never seen the code for it either). They most likely function by keeping a dictionary object updated with key/value pairs to store the bid and ask data at each price level. Here is one example that gets close to the concept but its a SuperDOM Column from community contributorgemify

    TraderLadder is a free order flow ladder for Ninjatrader v8. The SuperDOM column can display the following: Last trades Buys / Sells in a configurable sliding time window (defaults to 60 seconds) + Imbalance detection Last prints or Largest prints at price in sliding window Buy/Sell Delta in sliding window Session Buys / Sells + […]


    Kind regards,
    -ChrisL​

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment


      #3
      Ok, I guess the part I was missing is that if I want a bar type to have something other than OHLC,Volume, last bid/ask price, I can store that data myself in a custom object and then make that object available via a public function. And then I can access whatever is in that object in the OnRender of a custom Chart Style. That's a valid solution, right?

      Comment


        #4
        Hi Nicky, that is exactly correct. You will need to set DefaultChartStyle to your custom chart style

        this.DefaultChartStyle = (Gui.Chart.ChartStyleType)x; //where x is the integer value assigned to your custom ChartStyle.

        And make sure the chart style can access the custom data structure through the chartBars.Bars object.

        Comment


          #5
          Ok, Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          627 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X