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 Gmonte, 10-01-2022, 08:28 AM
          2 responses
          188 views
          0 likes
          Last Post charlesthomas  
          Started by ETFVoyageur, 05-18-2024, 12:45 AM
          5 responses
          31 views
          0 likes
          Last Post ETFVoyageur  
          Started by Kraken29, Today, 03:24 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by Skifree, Today, 11:47 AM
          5 responses
          19 views
          0 likes
          Last Post Skifree
          by Skifree
           
          Started by ETFVoyageur, Today, 10:34 AM
          10 responses
          25 views
          0 likes
          Last Post ETFVoyageur  
          Working...
          X