• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BuySellVolume Indicator not working properly

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

    BuySellVolume Indicator not working properly

    Hi,

    I used the BuySellVolume indicator, that comes with Ninja to derive my own delta indicator. Now I came across this weird thing:

    I added a print command, when a buy or sell is recorded by the indicator:
    {buys += tradeVol; Print("+ " + tradeVol);}
    {sells += tradeVol; Print("- " + tradeVol);}

    After throwing it on NQ 12-13 contract I got this:
    http://screencast.com/t/2ABRQ5eViT
    http://screencast.com/t/um3OvNUE81c

    Buys at ask price are recorded as sells and the other way around as well, this is weird. Red arrows show whats wrong imho.

    this is my setup for the T&S window:
    http://screencast.com/t/kS7SSBM9wV
    Last edited by td_910; 10-30-2013, 11:19 AM.

    #2
    Hello td_910,

    Thank you for your post.

    Please add Time[0] to your prints to show the timestamps of these items:
    Code:
    Print(Time[0] + " + " + tradeVol);
    Print(Time[0] + " - " + tradeVol);
    Please let me know if this clears up the item or if the same behavior is seen from the Output compared to the Time And Sales window.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hi Patrick,

      I reverted back to original colors for T&S window.
      have a look here: http://screencast.com/t/Qj0Tvr84bet
      I marked a trade at the ask. Shouldn't this be recorded as a buy?

      I attached indicator.

      Cheers

      Thomas
      Attached Files

      Comment


        #4
        Hello td_910,

        Thank you for your response.

        I have tested your indicator and found that it works perfectly on my end. I added the Close[0] to the prints as well to be certain the price is correct:
        Code:
         				if (Close[0] >= GetCurrentAsk())
        					{buys += tradeVol;	Print(Time[0] + " " + Close[0] + " + " + tradeVol);}
        				else if (Close[0] <= GetCurrentBid())
        					{sells += tradeVol;	Print(Time[0] + " " + Close[0] + " - " + tradeVol);}
        Who is your data feed provider? Does this only occur on the NQ 12-13?

        I look forward to your response.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Hi Patrick,

          this is NQ output and T&S from tonight http://screencast.com/t/UNfbFJl52X
          the indicator seems to record much less ticks, than incoming
          I marked 1st price in that time period

          ES seems to have same number of ticks, but completely out of line ratio B/S
          http://screencast.com/t/xV2NyUGQ

          I have Rithmic data feed, Broker is Optimus

          My workspace for this test has one chart open only

          I have I5 CPU with 4G RAM

          added from this morning - CL current contract
          http://screencast.com/t/3q9GrHF1F
          the 1st two ticks of the minute bar were recorded properly, but the rest is missing

          NQ this morning - recording sells as buys and vice versa
          http://screencast.com/t/ncRolfTIh0SB
          Last edited by td_910; 10-31-2013, 06:35 AM. Reason: added CL

          Comment


            #6
            Hello td_910,

            Thank you for your response.

            The BuySellVolume indicator is called when the bar updates with the method OnBarUpdate(), where as Time and Sales is called when OnMarketData() called.

            If you wish to compare to the Time and Sales window you can print information using the OnMarketData() method: http://www.ninjatrader.com/support/h...marketdata.htm
            Patrick H.NinjaTrader Customer Service

            Comment


              #7
              Hi Patrick
              I found this in an indicator on the download section, that the current BuySellVolume indicator looks like it was derived from.
              http://www.ninjatrader.com/support/f...&catid=1&id=53

              I guess this should do the trick?


              Code:
              protected override void OnMarketData(MarketDataEventArgs e)
                      {
                          if (e.MarketDataType != MarketDataType.Last || e.MarketData.Ask == null || e.MarketData.Bid == null)
                              return;
              
                          if (e.Price >= e.MarketData.Ask.Price)
                              buys += e.Volume;
                          else if (e.Price <= e.MarketData.Bid.Price)
                              sells += e.Volume;
                      }
              The indicator seems to work better than the one from NT7. It looks like it came with NT6.x.

              Funny thing with this indicator though is, that it "reliably" seems to skip the 1st tick of a bar?
              Last edited by td_910; 10-31-2013, 05:05 PM.

              Comment


                #8
                Hello td_910,

                Thank you for your response.

                That should produce the results based on OnMarketData().
                Patrick H.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Patrick,
                  I updated my last post. There is one problem left ;-).

                  One other question is, what version of the code should I use in market replay?

                  Thanks

                  Thomas

                  Comment


                    #10
                    Hi Td_910,

                    There may be some coding in the 6.5 version that would need to be updated for the 7 version if it is not working as expected.

                    Additionally, it is recommended that you use indicators that have been created to work with the version you are currently on. I.E. 6.5 with 6.5 and 7 with 7
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #11
                      Oh, many thanks for the valuable information.... I didn't know that

                      Lets put it different then:

                      The BuySellVolume indicator, that comes with NT7 is useless, as its losing ticks because its not started, when level one data is changing (OnBarUpdate instead of OnMarketData)

                      I thought there might be someone here to help/fix this and have a indicator, that could be used/shared for other NT users

                      best regards

                      Thomas
                      Last edited by td_910; 11-01-2013, 02:03 PM.

                      Comment


                        #12
                        If you're serious about having an accurate indicator I strongly urge you to visit BigMikeTrading, pay the $50 to join, and get the gomi package of indicators. I will caution you in advance, there is a steep learning curving to getting everything installed and operating, but to the best of my knowledge gomi's indicators are the best available.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by yeshujbp, 07-21-2019, 02:40 PM
                        2 responses
                        31 views
                        0 likes
                        Last Post omololu
                        by omololu
                         
                        Started by seagraph, Yesterday, 03:27 PM
                        1 response
                        23 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Started by NinjaCustomer, Today, 09:37 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_DrewO  
                        Started by stalt, Today, 07:52 AM
                        5 responses
                        16 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by im197, 07-30-2019, 12:29 PM
                        2 responses
                        10 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Working...
                        X