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

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 pechtri, 06-22-2023, 02:31 AM
                  9 responses
                  122 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by frankthearm, 04-18-2024, 09:08 AM
                  16 responses
                  65 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by habeebft, Today, 01:18 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by benmarkal, Today, 12:52 PM
                  2 responses
                  13 views
                  0 likes
                  Last Post benmarkal  
                  Started by f.saeidi, Today, 01:38 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Working...
                  X