Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator value on Price Chart

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

    Indicator value on Price Chart

    I am trying to have an indicator provide its current value on the price chart as well as half that value. I tried a code snippet I found on the forum but haven't been able to get past the debug stage. Can anyone help me out? I am looking for the the full, half, and quarter output of this particular indicator to be shown in the price chart.

    This is what I tried but must have not put it in the correct location in the code.
    {
    DrawTextFixed(
    "Indicator Value", "Indicator Value " + DominantCycle(1)[0].ToString("N1"), TextPosition.BottomRight, Color.Black, new Font("Arial", 10), Color.Empty, Color.Empty, 0);
    }
    Attached Files

    #2
    Taggart, do you see any compile issues with this snippet used? Or would you see a runtime error from your script reported when it's added to the chart? Those could be found in the Control Center log tab.

    Comment


      #3
      Bertrand,

      Thanks for your reply. Yes, I'm having problems compiling.

      Comment


        #4
        Thanks, that snippet should compile fine. Are you sure the error mentioned is from the script you're currently editing?

        Comment


          #5
          Yes, when I delete that snippet of code the compile errors disappear. Where is the best place to put that bit of code in the script? The compile error is "Namespace member declaration expected"

          Comment


            #6
            You would want to have it added in the OnBarUpdate() portion of your indicator, so it's called and updated on each bar as the chart gets populated with price / bar data.

            Comment


              #7
              I got it to compile, but when I loaded it, Ninja crashed.

              Comment


                #8
                Would you mind contacting me via Help > Mail to Support with the cs attached so I could check into?

                Comment


                  #9
                  Ok, but now I can't even open Ninja. It crashes every time on start up. Is there another way to contact you directly?

                  Comment


                    #10
                    This would be happening as NT tries to restore the workspace containing the chart that calls your indicator with the issue. You can go to Documents > NinjaTrader 7 > Workspaces and remove the _Workspaces.xml file and restart NT - this should then not open any workspace at startup.

                    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
                    333 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