Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Text and Draw.TextFixed giving compile errors

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

    Draw.Text and Draw.TextFixed giving compile errors

    Hi,
    I am trying to use Draw.Text and Draw.textFixed in an indicatorbut getting compilation errors.
    All I am trying to do is calculate a value in a variable and trying to show thw tha value in a text .
    I use the same indicator to write to a CSV file and the variable is written correctly but I cant show it on the panel of the indicator.
    Please help.

    Thanks
    yeskannan

    #2
    Hello yeskannan,

    What is the full error message?

    What is the code causing the error?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      tenta usar essa declaração: using NinjaTrader.NinjaScript.DrawingTools;

      Comment


        #4
        The code is very simple as follows:

        Zscore = (Wscore + Oscore + MSscore + MVscore);

        Draw.TextFixed(this, "tag1", Zscore.ToString, TextPosition.TopRight);


        Error message is as follows:
        The name 'Draw' does not exist in the current context CS0103 554 5
        The name 'TextPosition' does not exist in the current context CS0103 554 51
        But the CSV file capturing the data of all the Scores in the copde are having values and are written to the CSV File


        Attached Files

        Comment


          #5
          Hello yeskannan,

          I agree with JardelLobo38, that likely a using statement was removed.

          Incase there are other using statements that have been removed, or in case the structure of the script was also modified, I would recommend creating a new indicator using the NinjaScript Editor so that all of the correct using statements are included and the structure is correct. Then copy only the logic into OnBarUpdate() (and any dependent variable declarations)
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            HI Chelsea,

            I tried the using the USING statement and the erroir went away! Initially I didnt understand JardellLobo's reply.

            Now I am getting the following error.
            Argument 3: cannot convert from 'method group' to 'string' CS1503 555 34
            Zscore.ToString gives an error.
            Please help.

            Comment


              #7
              Hello yeskannan,

              What object type is Zscore?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hi Chelsea,

                Zscore is defined as double.

                I changed Zscore.ToString to the following statement and it gives no error.
                Draw.TextFixed(this, "tag1", Convert.ToString(Zscore), TextPosition.TopRight);

                Thanks a lot to you and JardellLobo.

                Regards


                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                571 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                331 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
                549 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                549 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X