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

Volmetric

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

    Volmetric

    Hi, I'm capturing this information on each bar. I'm looking for a way to see where most of the volume occurred. Does one of these values tell me this?

    double price;
    Print("======================================== =================================");
    Print("Bar: " + CurrentBar);
    Print("Trades: " + barsType.Volumes[CurrentBar].Trades);
    Print("Total Volume: " + barsType.Volumes[CurrentBar].TotalVolume);
    Print("Total Buying Volume: " + barsType.Volumes[CurrentBar].TotalBuyingVolume);
    Print("Total Selling Volume: " + barsType.Volumes[CurrentBar].TotalSellingVolume);
    Print("Delta for bar: " + barsType.Volumes[CurrentBar].BarDelta);
    Print("Delta for bar (%): " + barsType.Volumes[CurrentBar].GetDeltaPercent());
    Print("Delta for Close: " + barsType.Volumes[CurrentBar].GetDeltaForPrice(Close[0]));
    Print("Ask for Close: " + barsType.Volumes[CurrentBar].GetAskVolumeForPrice(Close[0]));
    Print("Bid for Close: " + barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]));
    Print("Volume for Close: " + barsType.Volumes[CurrentBar].GetTotalVolumeForPrice(Close[0]));
    Print("Maximum Ask: " + barsType.Volumes[CurrentBar].GetMaximumVolume(true, out price) + " at price: " + price);
    Print("Maximum Bid: " + barsType.Volumes[CurrentBar].GetMaximumVolume(false, out price) + " at price: " + price);
    Print("Maximum Combined: " + barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price) + " at price: " + price);
    Print("Maximum Positive Delta: " + barsType.Volumes[CurrentBar].GetMaximumPositiveDelta());
    Print("Maximum Negative Delta: " + barsType.Volumes[CurrentBar].GetMaximumNegativeDelta());
    Print("Max seen delta (bar): " + barsType.Volumes[CurrentBar].MaxSeenDelta);
    Print("Min seen delta (bar): " + barsType.Volumes[CurrentBar].MinSeenDelta);
    Print("Cumulative delta (bar): " + barsType.Volumes[CurrentBar].CumulativeDelta);

    #2
    Hi, thanks for posting.

    The GetMaximumVolume will return the price level where the max volume occurred.
    double price;
    Print("Maximum Combined: " + barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price) + " at price: " + price);

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank you!

      I guess I'm really trying to figure out by reading this data how I can see exhaustion, aggression, or reversals.

      Looking for things like low/reducing volume at extreme, POC at extreme, delta divergence, unfinished business, delta strength, bid/ask imbalances, etc.

      Comment


        #4
        Hi, is there a way to capture imbalances with the above API?

        Comment


          #5
          Hi shildebrand, We can calculate any value since we have the bid/ask volume at each level, but there is no values like imbalance, divergence, delta strength, etc that are pre-calculated or available through NinjaScript. One would need to calculate this manually based on their own formulas (since the source code for the OrderFlow+ tools is not publicly available).

          Best regards,
          -ChrisL

          Chris L.NinjaTrader Customer Service

          Comment


            #6
            Understood, but how would a diagonal value be captured?

            Comment


              #7
              Hi, thanks for your reply.

              I will need you to provide an exact formula or definition of what you want to calculate. Please also read carefully every data point you can acess from the Volumetric bars here:


              Best regards.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                It’s basically the way the chart identifies imbalances and makes the a different color. I want to have the ability to find those programmatically.

                Comment


                  #9
                  Hi, thanks for your reply.

                  All data points from the volumetric bars are available through Ninjascript, please look at the documentation I have given to find all the atomic data points of the volumetric bars. These points can be used for custom calculations in an Indicator or Strategy.

                  Best regards,
                  -ChrisL
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Yeah, I’ve got all that, but nothing I there talks about diagonal comparisons

                    Comment


                      #11
                      Hi, thanks for your reply.

                      There is a feature request for exposing imbalance data, SFT-3586. I will add a vote to this for you. The source code for the volumetric bars is not open source, so we must devise our own calculations for imbalances, diagonals, etc. To check if a feature has been added, check the release notes on future updates:


                      Best regards,
                      -ChrisL
                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12
                        Is there a way to get order size from the volumetric api?

                        Comment


                          #13
                          Hi, thanks for your reply.

                          In the volumetric bars there are the methods:
                          GetAskVolumeForPrice(double price)
                          GetBidVolumeForPrice(double price)

                          Best regards,
                          -ChrisL
                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            I’m trying to find the largest contract size order in each side for the bid and ask. Does this give me that?

                            Comment


                              #15
                              Hi shildebrand324 , thanks for your reply.

                              You will need to use more C# logic in your script to find the maximum value. Iterate each tick of each bar, calling GetAskVolumeForPrice(double price) or GetBidVolumeForPrice(double price) for each tick e.g.

                              Code:
                              var maxValue = -1;
                              var iValue;
                              for(double i = Low[0]; i <= High[0]; i+= TickSize)
                              {
                                  if(GetAskVolumeForPrice(i) > maxValue)
                                  {
                                      maxValue = GetAskVolumeForPrice(i);
                                      iValue = i;
                                  }
                              
                              }
                              
                              Print(maxValue);
                              Print(iValue);
                              Kind regards,
                              -ChrisL
                              Chris L.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by pechtri, 06-22-2023, 02:31 AM
                              10 responses
                              124 views
                              0 likes
                              Last Post Leeroy_Jenkins  
                              Started by judysamnt7, 03-13-2023, 09:11 AM
                              4 responses
                              59 views
                              0 likes
                              Last Post DynamicTest  
                              Started by ScottWalsh, Yesterday, 06:52 PM
                              4 responses
                              36 views
                              0 likes
                              Last Post ScottWalsh  
                              Started by olisav57, Yesterday, 07:39 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post olisav57  
                              Started by trilliantrader, Yesterday, 03:01 PM
                              2 responses
                              22 views
                              0 likes
                              Last Post helpwanted  
                              Working...
                              X