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

Can an indicator know what panel it is in?

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

    Can an indicator know what panel it is in?

    Are there methods that offer reflection type properties?

    Within the indicator I'd like to know:-
    1) What Panel is it running in?
    2) Is it running in more than one panel?

    Why?
    My Indicator raises Alerts & Plays sounds. If I have the same indicator in 3 different panels I only want one generating that info. (I have properties that make it look different in the other panels, eg: Background ribbon turned on when not in Price panel. extra lines that can be turned on / off) Orignally intended for debugging It actually helps trade.

    #2
    Hi David, unfortunately accessing those properties is not supported. As workaround you could create inputs to enter which background color for example is used on the chart and then check those off in your code to adjust indicator display.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Alternate idea

      Thanks,
      Creating a parameter the user can set did the trick.

      Another approach that worked well was to override the PLOT event & look at the "bounds.Top" parameter. Checking to see if it is greater than usual, ie 5. That let me determine that I wasn't in the PricePanel & thus set a global boolean that could be accessed by other routines.


      A slightly more complex version of that allowed me to create an array of "bounds.Top" values, again set once in the Plot event. Given that the user may resize the Panel I also needed to look at .Bottom & remove old values. The Indicators array was also handy for this purpose.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PhillT, Today, 02:16 PM
      2 responses
      3 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Started by Kaledus, Today, 01:29 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frankthearm, Yesterday, 09:08 AM
      14 responses
      47 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by gentlebenthebear, Today, 01:30 AM
      2 responses
      14 views
      0 likes
      Last Post gentlebenthebear  
      Started by PaulMohn, Today, 12:36 PM
      2 responses
      17 views
      0 likes
      Last Post PaulMohn  
      Working...
      X