Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninjascript generated text info columns for market analyzer

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

    Ninjascript generated text info columns for market analyzer

    Hi,

    I would like to have my indicator be able to post text in a cell on the marketanalyzer column. I figure I can use a plot text, where I can dynamically populate the content of the text field based on the logic of my indicator.
    Question 1: Is the above a correct way of doing it?

    Also, I would like the indicator to know if its been placed on a chart or on a market analyzer window. That is because, I would have to dynamically "hide or show" the plot text depending on where the indicator is placed, that is , show the plot text if the indicator is placed on a market analyzer window, and hide it if its placed on a chart.
    Question 2: how do i determine in ninjascript if the indicator is placed on a chart or marketanalyer such that i can put logic in the code to dynamically hide or not hide the contents of the plot text field.

    Question 3: Is what I am writing above the best way to achieve my goal? That is , to have a ninjascript logic dynamically create a text field that will present information that can be shown in the market analyzer.

    Thank you in advance for your help.

    #2
    Hello KhaosTrader,

    If you want to be able to have the script directly set text in a Market Analyzer then you would need to make a Market Analyzer Column script instead of an indicator.
    http://ninjatrader.com/support/helpG...zer_column.htm

    If you use an indicator, then you would have to set a numeric value on a plot and then use a cell filter in the Market Analyzer to replace that with text when the plot has a certain value.

    If you have an indicator in the Market Analyzer as an indicator column, use the code below to detect if this window is a Market Analyzer.
    Code:
    if (Parent is MarketAnalyzerColumnBase)
    	Print("Running on a Market Analyzer");
    To detect this is on a chart use:
    Code:
    if (ChartControl != null)
    	Print("Running on a Chart");
    The best way to achieve your goal is to make a Market Analyzer Column script.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      My indicator has a lot of logic, is there a way to have the indicator script conditionally run as a market analyzer column script? it would be nice to just "house" both the market analyzer column instructions inside the indicator...

      Do you have other suggestions? Or am I basically going to have to put mostly the same logic in two separate projects?

      Also, if I have to construct "cell conditions" , and I want to put in multiple columns to represent different time frames, is there a way to "copy and paste" cell conditions from one column to another?

      Thank you for your kind help.
      Last edited by KhaosTrader; 07-01-2016, 01:18 PM.

      Comment


        #4
        Hello KhaosTrader,

        You can call an indicator from a MarketAnalyzer Column script the same as you would from a strategy.

        Make the indicator do all the work and the logic, have the MA column update the text in the cell.

        (You would only use cell conditions if you plan on using an indicator in an Indicator Column. If you are making a Market Analyzer Column script, that would not be necessary.)
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by chbruno, Today, 04:10 PM
        0 responses
        3 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        6 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        127 views
        1 like
        Last Post caryc123  
        Working...
        X