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

Drawing in time axis

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

    Drawing in time axis

    Hi all, I have a special problem now. I need to draw onto time axis to print my own tick labels. How is it possible? (And I know it has to be possible, because some indicators use it ) I tried to get Graphics of ChartPanel and draw into axis area. That worked but just till the moment the time axis is redrawn.

    My next problem is how to change a string which is shown in list of indicators and also in a Label parameter. I like to use spaces and some special chars in this string and I couln't find out how to do that. Overriding of ToString() method just changes a string shown in a left top corner of the chart.

    Thank you for your help.

    #2
    Hello ku8az,

    There are unfortunately no supported techniques for drawing on the axis. You can explore intellisense to see the ChartControl options available, or receive input from other community members in this area.

    change a string which is shown in list of indicators
    Is this is the name of the indicator in the list you want to change? If you want to change this, Right Click in NS editor > Save As and Provide a new name.

    also in a Label parameter.
    The label can be changed by Overriding the string method. The technique is shown in this post:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan, thanks for your quick reply but it didn't help at all.

      Originally posted by NinjaTrader_RyanM View Post
      Is this is the name of the indicator in the list you want to change? If you want to change this, Right Click in NS editor > Save As and Provide a new name.
      If I select Save As, it doesn't allow me to use space or any special chars. And when I rename indicator file in file manager and compile, it still uses indicator class name in available Indicators list. I just need some technique how to replace this string with something else.

      Originally posted by NinjaTrader_RyanM View Post
      The label can be changed by Overriding the string method. The technique is shown in this post:
      http://www.ninjatrader.com/support/f...ead.php?t=4749
      You are right, but it is just only a label which is shown in the chart. I want to change a Label property in a Visual group of properties.

      Comment


        #4
        Thank you for your feedback. There is no other supported technique to renaming your indicator beyond Right Click > Save As in the NS editor.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Code:
          this.Name = "String to Show";
          in the Initialize() method.

          Comment


            #6
            AMAZING! I could swear to God I tried it before and it didn't work. Now it is ok. Thank you. Now it remains to solve the painting problem to time axis. I realized, that in the indicator I use as reference it is done (probably) with redraw (or replace with some panel) this axis and then draw strings onto it but still couldn't realize how to do that permanenty.

            Comment


              #7
              Originally posted by ku8az View Post
              AMAZING! ... Now it remains to solve the painting problem to time axis. I realized, that in the indicator I use as reference it is done (probably) with redraw (or replace with some panel) this axis and then draw strings onto it but still couldn't realize how to do that permanenty.
              That is probably being done with a custom Plot() override drawing at Bounds.Y or Bounds.Bottom.

              Come to think of it, you might not even need a custom plot, and can just place the drawing there as the y-parameter, but I have never tried.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by PaulMohn, Today, 12:36 PM
              0 responses
              1 view
              0 likes
              Last Post PaulMohn  
              Started by love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              37 views
              0 likes
              Last Post love2code2trade  
              Started by alifarahani, Today, 09:40 AM
              2 responses
              13 views
              0 likes
              Last Post alifarahani  
              Started by junkone, Today, 11:37 AM
              3 responses
              20 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by frankthearm, Yesterday, 09:08 AM
              12 responses
              44 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X