Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delta bid vs ask bars in same panel

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

    Delta bid vs ask bars in same panel

    I'm looking to build an indicator (well maybe 2) that will sum up the total volume hitting the bid and then the volume hitting the ask real-time for the current bar and then plot those two values as two bars charts within the same panel. The two bars will continue to update as long we're in the current bar and then they will start at 0 when the new bar starts. Is that setup currently possible? If so is it possible to place within OnBarUpdate or do I have to use OnMarketDepth?

    Thanks!

    #2
    Hello Jschmelz,

    Thanks for your post.

    You may want to look at these two indicators in the Ninjatrader ecosystem under the NT user apps. You can use as-is or adapt as you wish. They will work with tick replay as well should you want to see historical data.


    These indicators are publicly available on our NinjaTrader Ecosystem website:
    Here is a basic guideline of how to Import NinjaScripts.

    To import NinjaScripts you will need the original .zip file.

    To Import
    1. Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
    2. From the Control Center window select the menu Tools>import>Ninjascript add-on..
    3. Select the downloaded .zip file
    4. NinjaTrader will then confirm if the import has been successful.

    Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    Once installed, you may add the indicator to a chart by:
    • Right click your chart > indicators > Select the Indicator from the list on the left > New > OK

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.




    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Very interesting I'll check these out - thanks Paul!

      Comment


        #4
        One follow up question. I split up the code from the bstvolume script posted above into volume bid and volume ask. My goal is to have two bars updating in real time with bid and ask volume hit but I'd like the bars to be side by side in panel 2. At the moment it looks like I can either have them in separate panels or have them overlap each other. Is it possible to get a side by side comparison in NT8?

        Pictures of them overlapping and in separate panels provided below.
        Attached Files

        Comment


          #5
          Hello Jschmelz,

          Thanks for your reply.

          With current methods, one option would be to invert one of the plots so that it shows negative for display purposes and can then be in the same panel. For overlapping, you can set one plot to be significantly wider than the other to help differentiate. Please see the example, using BST volume indicator with the Total plot turned off.

          Click image for larger version

Name:	Jschmelz-1.PNG
Views:	184
Size:	25.0 KB
ID:	1122262

          Alternatively, you can create custom rendering which would involve a significant amount of coding using OnRender() and SharpDX.
          References:
          https://ninjatrader.com/support/help.../?onrender.htm
          https://ninjatrader.com/support/help..._rendering.htm
          You can see an example of the coding (with helpful comments) in the Ninjascript indicator "Sample Custom Render" in your platform.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Perfect - thanks again for the help!

            Comment


              #7
              Paul H, your BuySellStrength indicator is excellent. I am trying to use it to calculate the total delta for 3 or 4 or 5 consecutive bars. How can I access the final delta value for any particular bar?
              Thanks for any help you can provide.

              Comment


                #8
                Hello lesterboles,

                Thanks for your post.

                The BuySellStrength indicator is not something I created, I merely converted it from the NinjaTrader7 implementation by forum member tulanch.

                To access the values of the previous bars, you would need to run your script with Calculate.OnEachTick (as this is what the BuySellStrength indicator requires), check the final (previous) bar values on the first tick of the bar, and you would need to enable "Tick Replay" for the data series in order to access historical values (otherwise it will generate values only from the moment you add it to a chart).

                By using the first tick of the bar you will know that the prior bar [1] is closed and will get its final value, same with the [2], [3], [4],.... bars.

                References:
                https://ninjatrader.com/support/help...ttickofbar.htm
                https://ninjatrader.com/support/help...ick_replay.htm

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Paul and member tulanch. I now have it working and will try and integrate it into another indicator that I am working on. Not sure if the code is very efficient or if I can insert it elsewhere but it seems pretty responsive so far.
                  lesterboles

                  Click image for larger version

Name:	delta1 output.JPG
Views:	99
Size:	36.1 KB
ID:	1134493Click image for larger version

Name:	delta1.JPG
Views:	96
Size:	26.6 KB
ID:	1134494Click image for larger version

Name:	delta1 buysellstrength source.JPG
Views:	67
Size:	123.7 KB
ID:	1134495

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by fredrikn, 05-08-2019, 04:01 AM
                  57 responses
                  4,391 views
                  2 likes
                  Last Post Momentum  
                  Started by Blairski, Yesterday, 09:19 AM
                  2 responses
                  11 views
                  0 likes
                  Last Post Blairski  
                  Started by tonynt, Today, 09:33 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by minotti1, Today, 08:31 AM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Jim  
                  Started by SmartArtsStudio, 05-15-2021, 10:46 AM
                  1 response
                  15 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X