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 rajneesh.sehgal, Today, 12:06 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by mo_fi, 01-21-2021, 10:08 PM
            22 responses
            1,310 views
            0 likes
            Last Post Wessel
            by Wessel
             
            Started by ezrollin, 01-12-2022, 03:43 PM
            2 responses
            32 views
            0 likes
            Last Post iq200
            by iq200
             
            Started by Red_70, Today, 11:07 AM
            3 responses
            10 views
            0 likes
            Last Post Red_70
            by Red_70
             
            Started by shodson, Today, 11:08 AM
            3 responses
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X