Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume total seems to depend on chart settings

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

    Volume total seems to depend on chart settings

    Hi,

    I made a simple indicator that sums total volume of the day
    Code:
            #region Variables
            // Wizard generated variables
            // User defined variables (add any user defined variables below)
            double totalvolume=0.0f;
            
            #endregion
    
            /// <summary>
            /// This method is used to configure the indicator and is called once before any bar data is loaded.
            /// </summary>
            protected override void Initialize()
            {
                Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Bar, "VolSum"));
                Overlay                = false;
                CalculateOnBarClose =false;
                
            }
    
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
                   //only use historical
                
                if (Historical)
                {
                    if (Bars.SessionBreak)
                        totalvolume=0;
            
                    totalvolume+= Volume[0];
                    VolSum.Set(totalvolume);    
                }
    
            }
    It appears the sum at the end of the day depends on the chart settings : 1K vol, 10 k volume and 50 k Volume have different closing volumes.

    Using very small granularity : 10 ticks, 1000 give the same "correct" volume, but when the granularity increases, some volume seams to disappear.

    It's probly an erro in my indicator but it's very simple...

    Any clue ?
    Attached Files

    #2
    Hello Gomi,

    You should make sure that you're looking at the same bars across the different tests. Since NinjaTrader time stamps when bars end, there can be differences when comparing against time and tick, volume.


    The difference between your Indicator [0] - Indicator [1] should be the same as VOL()[0], so checking when these values are different should help identify what's happening. .
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      In the meantime I made a "Reload historical data" and restarted NT, and now the problem is gone.

      Will see tomorrow if I can reproduce.

      Thanks

      Comment


        #4
        You might want to check "Renko 1" though, it seem there is some volume constantly added on each bar. Renko > 1 is OK.

        Comment


          #5
          Gomi... I use volume charts, and I def noticed the problem before myself. I think its the way ninja handles incoming ticks on volume charts. I ran a chart live and( on zenfire) and i was comparing it to my dtn feed on a different computer... after midday, i noticed some differences, meaning the bars are different. Normally, i would say its because maybe zenfire bundles ticks. But when i hit reload historical data, the charts matched.
          Its happened more than once.

          Comment


            #6
            Originally posted by gomifromparis View Post
            You might want to check "Renko 1" though, it seem there is some volume constantly added on each bar. Renko > 1 is OK.
            Thanks for reporting in gomi, we'll look into it.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks Bertrand, I was looking for ways to improve mapping volume from GomRecorder indicators, so was looking at difference between total of NT volume - difference in total Gom volume. As they use same data, the difference should be fluctuating around 0, which it does for almost every chart (see Renko 2 chart) except Renko 1 which shows an increasing line, showing a linear increasing difference between both volumes, meaning each Vol[0] of the Renko 1 chart get a constant amount of too much volume.
              Attached Files

              Comment


                #8
                I've been looking at this and so far haven't seen any issues with renko 1 bar. Can you share the indicator files and details of your test? I copied your script in the first post and have it draw a diamond when indicated below. I'm only looking at historical values.

                if (Gomi[0] - Gomi[1] != VOL()[0])
                DrawDiamond(
                "a" + CurrentBar, true, 0, High[0] + TickSize, Color.Red);
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Ryan,

                  You're not going to find it that way, by contruction
                  Gomi[0] - Gomi[1] = Vol[0] ....

                  Try plotting in console the sum of volume of last 10 days in the ES

                  Here are my results :
                  10 000 Volume chart : 12590377
                  150 tick chart : 12590377
                  30 second chart : 12590287

                  Renko 2 chart : 12592723 , all chart is 2367 bars long
                  Renko 1 chart : 12608305 , all chart is 17949 bars long.

                  As you can see there is a mismatch in Renko volumes as compared to other volumes. Now if we assume each volume bar in Renko charts is off by 1, we could estimate corrected volumes :

                  Renko 2 chart :
                  12592723 - 2367 = 12590356
                  Renko 1 chart :
                  12608305 - 17949 = 12590356

                  Hey, seems like I did all the debugging work... And I don't even use Renko charts....!



                  Originally posted by NinjaTrader_RyanM View Post
                  I've been looking at this and so far haven't seen any issues with renko 1 bar. Can you share the indicator files and details of your test? I copied your script in the first post and have it draw a diamond when indicated below. I'm only looking at historical values.

                  if (Gomi[0] - Gomi[1] != VOL()[0])
                  DrawDiamond(
                  "a" + CurrentBar, true, 0, High[0] + TickSize, Color.Red);

                  Comment


                    #10
                    lol.... nice gomi.

                    Comment


                      #11
                      Hi Gomi,

                      I see differences but they are not so closely correlated with the number of bars on each chart.

                      Your test doesn't show that extra volume is added to renko 1. It is is difficult to line up so that you are comparing the exact same data across these different series. The time stamp of the renko bars is not even and this can lead to viewing different data even when all the parameters are the same.

                      Take a look at the time stamp of the first bar in the series. This will be different when comparing renko 1 versus renko 2.

                      You'll see the same thing on minute series as well. A 5 and 10 minute volume numbers should be the same. A 3 minute and 60 minute will not.
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi Ryan,

                        Sorry but despite your efforts you guys from support are not going to get me smash my head against the keyboard like I did on the ninja 7 timezone issue. As I actually don't care at all about renko volume, I won't insist this time.

                        You can close the thread.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by cls71, Today, 04:45 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post cls71
                        by cls71
                         
                        Started by mjairg, 07-20-2023, 11:57 PM
                        3 responses
                        213 views
                        1 like
                        Last Post PaulMohn  
                        Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                        4 responses
                        544 views
                        0 likes
                        Last Post PaulMohn  
                        Started by GLFX005, Today, 03:23 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post GLFX005
                        by GLFX005
                         
                        Started by XXtrader, Yesterday, 11:30 PM
                        2 responses
                        12 views
                        0 likes
                        Last Post XXtrader  
                        Working...
                        X