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

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:
    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    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:
    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
    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.

    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.

        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


          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
          Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

          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
          Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
          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

            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.


              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().

                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 jclose, Today, 09:37 PM
                        0 responses
                        4 views
                        0 likes
                        Last Post jclose
                        by jclose
                         
                        Started by WeyldFalcon, 08-07-2020, 06:13 AM
                        10 responses
                        1,413 views
                        0 likes
                        Last Post Traderontheroad  
                        Started by firefoxforum12, Today, 08:53 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post firefoxforum12  
                        Started by stafe, Today, 08:34 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post stafe
                        by stafe
                         
                        Started by sastrades, 01-31-2024, 10:19 PM
                        11 responses
                        169 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Working...
                        X