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

Mini Data Box

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

    Mini Data Box

    Currently the Mini Data Box is only displayed for 1 bar when the middle mouse button is held down. Is there a way for me to incorporate it into an indicator so that I can display it for more than 1 bar in different locations, and leave it on the chart until I close it?

    Thank you.

    #2
    Hello GeorgeW,

    Thank you for your post.

    This would not be something you could program. The Mini Data Box should stay visible as long as the Middle Mouse Button is held down. Are you seeing something different?

    Comment


      #3
      No, I am not seeing something different. Just that I wanted to build some indicators and have the values visible in the Mini Data Box all the time at several bars that I select.

      Comment


        #4
        Line Breaks for Drawtext

        This is a slightly different question but related, so I will ask it here. Is there a way for me to include line breaks in DrawText? I have the following line in my code:

        DrawText (TagdiffV + CurrentBar, diffV.ToString(), 0, Low[0] - 2 * TickSize, Color.Red);

        I would like to add other varibles to the ToString part. It seems to work if I just add them as follows: diffV.ToString + AltV.ToString etc, but it places them in a line next to each other on the chart. I would like them to appear on separate lines in a similar manner to the Mini Data Box. Is there a way to code these line breaks in NT?

        Thanks.

        Comment


          #5
          Hello GeorgeW,

          Thank you for your note.

          You can use \n in the string. For example:
          Code:
          DrawText("mytag", "Hello\nThere", 0, High[0] + (4 * TickSize), Color.Black);

          Comment


            #6
            Thanks for your response Partick_H. That works if I just want to see the words on the charts, but if the words are variables for calculations, I do not see the figures. If I remove the quotes it will not compile. Is there a way where "Hello" = 250 and "There" = 2 (after internal calculations) for me to see both figures on separate lines?

            Comment


              #7
              Hello GeorgeW,

              You would have to use '+'.

              For example:
              Code:
              DrawText("mytag", 250 + "\n" + 2, 0, High[0] + (4 * TickSize), Color.Black);

              Comment


                #8
                Originally posted by GeorgeW View Post
                This is a slightly different question but related, so I will ask it here. Is there a way for me to include line breaks in DrawText? I have the following line in my code:

                DrawText (TagdiffV + CurrentBar, diffV.ToString(), 0, Low[0] - 2 * TickSize, Color.Red);

                I would like to add other varibles to the ToString part. It seems to work if I just add them as follows: diffV.ToString + AltV.ToString etc, but it places them in a line next to each other on the chart. I would like them to appear on separate lines in a similar manner to the Mini Data Box. Is there a way to code these line breaks in NT?

                Thanks.
                Code:
                diffV.ToString() + "\n" + AltV.ToString()
                Read up about "escape sequences".

                Comment


                  #9
                  That works beautifully, Patrick_H and koganam. I'll start doing some reading on those escape sequences.

                  Thank you!
                  Last edited by GeorgeW; 12-18-2015, 08:39 AM.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by funk10101, Today, 12:02 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post funk10101  
                  Started by gravdigaz6, Yesterday, 11:40 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by MarianApalaghiei, Yesterday, 10:49 PM
                  3 responses
                  10 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by XXtrader, Yesterday, 11:30 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post XXtrader  
                  Started by love2code2trade, 04-17-2024, 01:45 PM
                  4 responses
                  28 views
                  0 likes
                  Last Post love2code2trade  
                  Working...
                  X