Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to find analyzer properties in ninjascript?

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

    How to find analyzer properties in ninjascript?

    Hello,

    I wish to:

    1. Tell an indicator if it is in a chart or a market analyzer.
    2. Find the properties of the analyzer.


    1. I am currently using:

    PHP Code:

    if (ChartControl == null)
    {
          
    //then it is not in a chart

    I could see this being a little too open in syntax and possibly not safe. Is there another alternative? I thought of something like this in pseudocode:

    PHP Code:

    if MarketAnalyzerColumn is the parent of the indicator then it is in a market analyzer 
    2. I tried to use this code below to access the font within the market analyzer that the indicator is attached to:

    PHP Code:

    SimpleFont font 
    = new SimpleFont();

    NinjaTrader.Gui.MarketAnalyzer.MarketAnalyzerProperties prop = new NinjaTrader.Gui.MarketAnalyzer.MarketAnalyzerProperties();
                    
    font prop.FontInfo
    This found 'a font' but since it is a new instance of MarketAnalyzerProperties then it returned only the default font of NT8... Arial.

    How would I find the user selected font of the market analyzer that the indicator is currently active in? eg. If I am using 'Tahoma' then it should return 'Tahoma'.

    Thank you in advance,

    Simon.

    #2
    Hello,

    Thank you for the question.

    To check if the item is in the MA, you could use the following:

    Code:
     if (Parent is MarketAnalyzerColumnBase)
    	Print("Running on a Market Analyzer");
    Currently there is no documented way to get or set properties of the MA window from a indicator specifically, there is a feature request in place for this which I will add a vote. SFT-1270

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you Jesse,

      That is so simple

      Yes that ability would be good. Basically I am making a custom font for use in the analyzer. I plan to share this publicly with an indicator so I need to set some fail safe conditions to make sure people have the right font setting in the analyzer.
      Although I am not a vendor I do understand that these sort of items need to be available for a customer base that often fails to read instructions

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,606 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      8 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      18 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      4 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      13 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X