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

reference the BuySellVolume indicator

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

    reference the BuySellVolume indicator

    I made a simple Delta indicator based on the built in BuySellVolume indicator but when I reference a value from it to other indicators it only shows 0. I tried to pass both simple doubles or <series>double, combined them in any way but with no results.
    In fact even when I'm referencing BuySellVolume I only get 0, (with calculate set on OnEachTick for both indicators, also tick reply enabled). So how can I grab values from this type of indicator ?
    Thank You!

    #2
    Hello nothingtrader,

    Thank you for your note.

    I'm attaching a pair of example scripts - the first uses BuySellVolume, calculates the difference between buys and sells, and plots both that and an MA of that to an indicator panel. I'm also including a second indicator that references the first, grabs the values it generated and prints those to the lower right corner of the chart. I've tested on my end with Tick Replay on and this populates values as I would expect.

    If you import this do you see the same on your end or do you still get 0 values?

    Thanks in advance; I look forward to assisting you further.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      It works perfectly, now I know that I have to mention the referenced tick based indicator in state dataloaded. This tiny one got me starring clueless at the screen for hours.
      Thank you for your wonderful assistance!

      Comment


        #4
        Now can you please direct me how can I print the BSDiff[0] data on the output window but when the bar closes, not on each tick (like at every bar close on the indicator panel). I've made a different indicator setted up on OnBarClose but it will only print 0 when I refference BSDiff[0]. I've tried to store the summed values into a separate double/ series double to reference that, but still 0.
        Thank you!

        Comment


          #5
          Hello nothingtrader,

          Thank you for your reply.

          You'd still have to run the indicator calling BuySellVolume on each tick since BuySellVolume will inherit the hosting indicator's Calculate settings, but what you could do is check to see if it's the first tick of a new bar and print the bar that just closed's BSDiff value to the chart:

          if(IsFirstTIckOfBar)
          {
          Draw.TextFixed(this, "myText", "BSDiff: " + BSDiff[1], TextPosition.BottomRight);
          }

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment


            #6
            It works
            Thank you very much!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by PaulMohn, Today, 03:49 AM
            0 responses
            6 views
            0 likes
            Last Post PaulMohn  
            Started by inanazsocial, Today, 01:15 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by rocketman7, Today, 02:12 AM
            0 responses
            10 views
            0 likes
            Last Post rocketman7  
            Started by dustydbayer, Today, 01:59 AM
            0 responses
            4 views
            0 likes
            Last Post dustydbayer  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            5 responses
            23 views
            0 likes
            Last Post trilliantrader  
            Working...
            X