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 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 GussJ, 03-04-2020, 03:11 PM
        15 responses
        3,269 views
        0 likes
        Last Post xiinteractive  
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        2 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        10 responses
        402 views
        1 like
        Last Post beobast
        by beobast
         
        Working...
        X