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

Get price of POC and Value Area (Order Flow Volume Profile Indicator) in NinjaScript

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

    Get price of POC and Value Area (Order Flow Volume Profile Indicator) in NinjaScript

    Hello,

    how can I get the price of POC and Value Area in NinjaScript?
    I can not find any function.

    Thank you!
    Thomas

    #2
    Hello teafortwo,

    Thanks for your post.

    Order Flow Volume Profile is not exposed for NinjaScript access.

    You could get POC of a bar from Order Flow Volumetric bars with GetMaximumVolume, and you could consider looping through each price level in a bar to check GetTotalVolumeForPrice and identify where the Value Area lies. (These are data access methods specific to Volumetric bars.)

    After you have calculated the Value Area, you would have already calculated the Value Area High or the Value Area Low.

    Volumetric Bars data access methods - https://ninjatrader.com/support/help...tric_bars2.htm

    If you would like to more easily fetch these values from an indicator, you could consider a different Volume Profile indicator that exposes these values as plots.

    A free indicator that you may wish to consider can be found below. (Note: there is no guarantee that these values will match our in house Order Flow Volume Profile indicator.)

    DValueArea - https://ninjatraderecosystem.com/use...ad/dvaluearea/

    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.

    If you are interested in navigating the EcoSystem for vendor made AddOns please let us know and we can have a colleague reach out.

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hallo Jim,
      for which Bar is returning GetTotalVolumeForPrice the total volume?

      Comment


        #4
        Hello teafortwo,

        GetTotalVolumeForPrice will get the total volume for the price level of the bar that you specify.

        Print("Volume for Close: " + barsType.Volumes[CurrentBar].GetTotalVolumeForPrice(Close[0]));

        CurrentBar is a bar index which counts left to right and increases as the script processes the next bar.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello,

          barType is allways NULL, why?


          protected override void OnBarUpdate()
          {
          if (Bars == null)
          return;

          NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

          if (barsType == null)
          return;


          try
          {

          Print("Volume for Close: " + barsType.Volumes[CurrentBar].GetTotalVolumeForPrice(Close[0]));

          ...

          Comment


            #6
            Hello teafortwo,

            If the variable is null that would indicate the cast was not successful. The sample expects this to have the primary series as the volumetric, is that how you currently have it? If you are using a secondary series as the volumetric you would have to use what is noted in the sample comments instead or:

            Code:
            NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
            We look forward to assisting.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Originally posted by teafortwo View Post
              Hello,

              how can I get the price of POC and Value Area in NinjaScript?
              I can not find any function.

              Thank you!
              Thomas
              Would be great to see an example of a bar's value area in the Helo Guide.

              Comment


                #8
                Hello Trader17,

                The value area is not currently exposed as a property, you an see post #2 for a suggestion on how to calculate the value area based on the external indicator.

                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thanks NinjaTrader_Jesse I do not need the DValue as it calculates over an entire session. It is the Profile on each bar indicator that is built in NT8 that is not plotting correctly and what I was looking for to be exact. I already made a loop to calculate the values in a volumetric bar and mine matched up with NT8 values for VAL and VAH and apparently both are wrong. I have shown NinjaTrader_BrandonH a few examples of this in another post. Hopefully NT8 resolves the internal issue soon.
                  Cheers.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by aa731, Today, 02:54 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post aa731
                  by aa731
                   
                  Started by thanajo, 05-04-2021, 02:11 AM
                  3 responses
                  469 views
                  0 likes
                  Last Post tradingnasdaqprueba  
                  Started by Christopher_R, Today, 12:29 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post Christopher_R  
                  Started by sidlercom80, 10-28-2023, 08:49 AM
                  166 responses
                  2,237 views
                  0 likes
                  Last Post sidlercom80  
                  Started by thread, Yesterday, 11:58 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post thread
                  by thread
                   
                  Working...
                  X