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

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:	737
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:


          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:



                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:	618
Size:	36.1 KB
ID:	1134493Click image for larger version

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

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

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by funk10101, Today, 09:43 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post funk10101  
                  Started by pkefal, 04-11-2024, 07:39 AM
                  11 responses
                  36 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Yesterday, 08:51 AM
                  8 responses
                  44 views
                  0 likes
                  Last Post bill2023  
                  Started by yertle, Today, 08:38 AM
                  6 responses
                  26 views
                  0 likes
                  Last Post ryjoga
                  by ryjoga
                   
                  Started by algospoke, Yesterday, 06:40 PM
                  2 responses
                  24 views
                  0 likes
                  Last Post algospoke  
                  Working...
                  X