Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText with Text Option in Indicator Window

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

    DrawText with Text Option in Indicator Window

    I'm trying to include a Parameter in the Indicator Window that I can type Text into that will show up on Price Panel.

    Code:
    [FONT=Courier New]DrawText("tag1", "[COLOR=red][B]This text was written from Indicator Window[/B][/COLOR]", 10, 1000, Color.Black);[/FONT]

    #2
    Not sure I follow. What indicator window are you talking about? If you mean where you set indicator parameters, just create yourself a string input and then tell it to DrawText on that string variable.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Draw Text String Variable

      Yes. I was refering to Indicator Window via the Chart...

      I would assume that some code is needed in the Properties region.

      Kinda struggling with it right now...Maybe if I can post some code we can go from there

      Thank You Josh

      Comment


        #4
        duck_CA,

        I recommend you just use the Indicator Wizard to see what kind of code it will generate. That is the code you will need in the Properties region.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Sounds Good...Thanks

          I will ask the "wizard" or is that you ? lol

          Comment


            #6
            Haha. Tools->New NinjaScript->Indicator.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Draw Text in Indicator Window

              I'm trying to be able and use the new "Text" Parameter so that anything that is typed will show up on the chart...

              I'm I getting warmer?


              Code:
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Variables[/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#008000]// Wizard generated variables[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] text = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]@"draw text here"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]; [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000]// Default setting for Text[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#008000]// User defined variables (add any user defined variables below)[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]#endregion[/COLOR][/SIZE][/FONT]
              Code:
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]protected[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]override[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] OnBarUpdate()[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
              [FONT=Courier New][SIZE=2][COLOR=#008000]// Condition set 1[/COLOR][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (Low[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]] < High[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]])[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
              [SIZE=2][FONT=Courier New]DrawText([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"My text"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] + CurrentBar, [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"draw me some text"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], Color.Red);[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
              Code:
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Properties[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New][Description([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"this should draw text in indicator window"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
              [SIZE=2][FONT=Courier New][Category([/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#800000]"Parameters"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2])][/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] Text[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]get[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] text; }[/SIZE][/FONT]
              [FONT=Courier New][SIZE=2][COLOR=#0000ff]set[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] { text = value; }[/SIZE][/FONT]
              [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]

              Comment


                #8
                DrawText("My text" + CurrentBar, Text, 0, 0, Color.Red);
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Dang it !!! I knew I was close

                  On to the next item... Thanks Josh !

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  574 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  332 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  553 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  551 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X