Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing lines on indicator IN data window

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

    Drawing lines on indicator IN data window

    Hi,

    I wanted to draw some horizontal lines on my indicator values. I set DrawOnPricePanel to false to enable me to do this and it works perfectly.

    However, I also use the indicator and put it in the main data window, i.e. not in it's own panel. When I do this, the lines no longer work. I set DrawOnPricePanel to true, but I guess the lines are then drawing on the wrong scale.

    So, the questions are (I could not find the answer!)

    how do I detect if the indicator is running in the data window, not in it's own panel
    and 2, if I detect that is the case, how do I draw the lines using the left hand scale, not the right hand price one of the data set?

    Many thanks,

    Paul

    #2
    Hello pjsmith, and thank you for your question.

    The feature you are discussing, an indicator revealing to you which panel it is in via NinjaScript, is not documented, and thus providing support for it is beyond the scope of our support. There is an object called ChartControl, which you can find some usage examples of in the @HeikenAshi.cs indicator, but I was unable to find any indication as far as what panel you were in both in this object directly and in its ChartControl.ChartPanel object. You may want to use IntelliSense (documented in this publicly available MSDN link here, https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx ) to aid you in your investigation.

    NinjaTrader 8 does support this, and this is documented here,



    To retrieve your index, you would simply loop through chartpanels until you found your chart. However, as intellisense will show you, NinjaTrader 7 has no such ChartPanels object.

    We are happy to help with any other questions that come up.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hello again pjsmith,

      I misspoke earlier, Print(Panel.ToString()); will show you which panel you are in in the output window. You can review this output and perform string matching to determine which panel you are in programmatically.

      To your second question, I would recommend trying the ScaleJustification property of your indicator, documented here,



      I believe your indicator will then read from the desired scale, but this is not behavior I have tested.
      Last edited by NinjaTrader_JessicaP; 08-12-2016, 12:21 PM.
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Perfect. Thanks. Your last updated response hit the nail on the head perfectly.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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