Announcement

Collapse
No announcement yet.

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

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bootize, Today, 08:37 AM
            0 responses
            4 views
            0 likes
            Last Post bootize
            by bootize
             
            Started by _Zero_, 01-06-2020, 01:16 PM
            4 responses
            138 views
            2 likes
            Last Post globaljobber  
            Started by sukhob, Yesterday, 04:27 PM
            1 response
            20 views
            0 likes
            Last Post zacharydw00  
            Started by zacharydw00, Yesterday, 05:36 PM
            0 responses
            6 views
            0 likes
            Last Post zacharydw00  
            Started by podowitz, Yesterday, 04:18 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Working...
            X