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

Creating an indicator like Market Delta

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

    Creating an indicator like Market Delta

    I just started getting familiar with NinjaScript in order to create a footprint chart similar to Market Delta and I have a few questions. Attached is a draft footprint chart that I put together for reference. The number at the bottom of the bid/ask info is the Delta. I am using the DrawText() function to print the bid/ask info. So here are my questions:
    1. How do I get the footprint color shading to be of equal length (uniform) for the bid/ask at each price?
    2. How do I align the x's on each line?
    3. How do I create a text panel displaying Delta statistics (e.g., Bid, Ask, Delta, Delta Chg, Cum Delta, Volume, etc)?
    I'm just looking for someone to point me in the right direction, by either telling me the function I should be using or a link to relevant examples. Thanks.

    Click image for larger version

Name:	footprint.GIF
Views:	1
Size:	30.5 KB
ID:	890641
    Last edited by antonio; 01-20-2009, 01:30 PM.

    #2
    1. I am not sure what you mean by equal length? You want them to line up equally vertically down the various columns?
    2. Sorry it is beyond the level we can offer support for. It is not simple. There is no built in function to do it. You may need to use custom Plot() to achieve the display you want.
    3. You just need to use DrawText and find the relevant locations on the screen to print to with the information you want.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh, thanks for the quick reply. Below are my follow-up questions/comments.
      1. Yes, I would like the color boxes to line up vertically with the left/right edges of the box being aligned with the left/right edges of all the other boxes above/below it to give it a neat look.
      2. I will take a look at the Plot() function.
      3. If I use DrawText() to print the statistics, wouldn't the text move off the screen as new price data arrives? I'm assuming that you're suggesting printing the text in the price panel. I would like to view the statistics at all times.

      Comment


        #4
        1. You could use DrawRectangle() of the same parameters for the boxes yes?
        3. Try DrawTextFixed(). It will be in the price panel, but it will not move.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I'm trying to align the bid/ask data within a cell in the chart. Currently, the data is spanning across cells. I think I need to change the price axis so that the price is "between the grid lines" as opposed to "at the grid lines." How do I do this? Attached is a chart illustrating what I'm trying to do. Hope this makes sense. Thanks.
          Attached Files

          Comment


            #6
            Hi antonio, you would need to overwrite the Plot method, which is unfortunately not supported.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Bertrand, thanks for your reply.

              Comment


                #8
                Hi Antonio, Can you share your code here?

                Hi Antonio, Can you share your code here?
                Thanks.

                Comment


                  #9
                  I would also like to check out the code if you don't mind. I might be able to get it working with plot().

                  Comment


                    #10
                    Originally posted by darthtrader View Post
                    I would also like to check out the code if you don't mind. I might be able to get it working with plot().
                    Hi Antonio,

                    I would also like to see the code for the indicator, looks great

                    Comment


                      #11
                      I currently run my "MarketDelta" indicator twice, once to get the bid/ask on the price chart and again to get the bid/ask stats in an indicator panel (see attached figure). Is there a way to run the indicator once and have data displayed in panels 1 & 2. I tried changing "DrawOnPricePanel" and "Panel" parameters in the code in real-time, but data is only displayed in the price panel. Is there something else I need to do? Thanks.

                      Click image for larger version

Name:	footprint.GIF
Views:	1
Size:	67.6 KB
ID:	850219

                      Comment


                        #12
                        Hi antonio, unfortunately this is not supported. Stay with the solution you have right now and you should be good.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by antonio View Post
                          I currently run my "MarketDelta" indicator twice, once to get the bid/ask on the price chart and again to get the bid/ask stats in an indicator panel (see attached figure). Is there a way to run the indicator once and have data displayed in panels 1 & 2. I tried changing "DrawOnPricePanel" and "Panel" parameters in the code in real-time, but data is only displayed in the price panel. Is there something else I need to do? Thanks.

                          [ATTACH]4499[/ATTACH]
                          Maybe this help http://www.ninjatrader-support2.com/...highlight=draw

                          Comment


                            #14
                            PrTester, thanks for the link. I tried the suggestion in that thread, but it didn't work for me. Did you have any success printing to both panels from one indicator?

                            Comment


                              #15
                              Originally posted by antonio View Post
                              PrTester, thanks for the link. I tried the suggestion in that thread, but it didn't work for me. Did you have any success printing to both panels from one indicator?

                              Yes, there's a file in the thread. works for me.

                              Regards

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Radano, 06-10-2021, 01:40 AM
                              19 responses
                              606 views
                              0 likes
                              Last Post Radano
                              by Radano
                               
                              Started by KenneGaray, Today, 03:48 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post KenneGaray  
                              Started by thanajo, 05-04-2021, 02:11 AM
                              4 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              11 views
                              0 likes
                              Last Post Christopher_R  
                              Working...
                              X