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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Ok, Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by trilliantrader, 04-18-2024, 08:16 AM
          4 responses
          16 views
          0 likes
          Last Post trilliantrader  
          Started by mgco4you, Today, 09:46 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by wzgy0920, Today, 09:53 PM
          0 responses
          6 views
          0 likes
          Last Post wzgy0920  
          Started by Rapine Heihei, Today, 08:19 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          9 views
          0 likes
          Last Post Rapine Heihei  
          Working...
          X