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

Code example of Indicator that works in Market Analyzer

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

    Code example of Indicator that works in Market Analyzer

    Hello,

    Are there examples of how to use an indicator in a Market Analyzer, so that RealTime data is available to the indicator?

    Indicator Code and how to set up_

    thx

    #2
    Hello llanqui,

    Any indicator that sets a plot value and has a public Series<double> returning the Value series for that plot can be used in the Market Analyzer.
    https://ninjatrader.com/support/foru...er#post1182264

    Below is a link to an example indicator that will plot when a cross occurs.
    https://ninjatrader.com/support/foru...238#post812238

    To add an indicator to the Market Analyzer, add the Indicator column and select the indicator from the drop-down.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      ok, thanks...I've ported from NT7 and could not see where NT8 was so different

      Comment


        #4
        I need to be more specific....

        How can I tell State = State.RealTime data from State.Historical?

        in an Indicator that is running inside a Market Analyzer?



        The indicator you linked to does not differentiate....

        It seems that an indicator running in Market Analyzer cannot tell the difference?

        but if it is running on a Chart, it works as expected?

        Thx

        Comment


          #5
          Hello llanqui,

          There are quite a few changes from NinjaTrader 7 to NinjaTrader 8, particularly on the override method names.

          Below is a link to a forum post on porting scripts.
          https://ninjatrader.com/support/foru...313#post490313

          How can I tell State = State.RealTime data from State.Historical?
          if (State == State.Realtime)
          {
          // this is realtime data
          }

          if (State == State.Historical)
          {
          // this is historical data
          }

          Below is a link to the help guide.
          https://ninjatrader.com/support/help.../nt8/state.htm

          in an Indicator that is running inside a Market Analyzer?
          The above is still true, this does not change because the indicator is added to a Market Analyzer window. Nothing about the indicator changes when added to a Market Analyzer window.

          The indicator you linked to does not differentiate....
          The example I provided does not differentiate between State.Historical and State.Realtime.

          You asked:
          "Are there examples of how to use an indicator in a Market Analyzer, so that RealTime data is available to the indicator?"

          All indicators have real-time data available to the indicator if you are connected to a real-time data. There is no question about differentiating anything in your original post.


          It seems that an indicator running in Market Analyzer cannot tell the difference?
          Yes, an indicator added to any window can check the State property. See above.

          but if it is running on a Chart, it works as expected?
          This makes no difference. Chart, Market Analyzer, SuperDOM window, called from a Strategy, all the same. The State property works the same.

          Are you sure you are asking about an Indicator and not a different type of script? (MarketAnalyzerColumn scripts are not indicators)
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mongo, Today, 11:05 AM
          3 responses
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by traderqz, Today, 12:06 AM
          6 responses
          13 views
          0 likes
          Last Post traderqz  
          Started by Skifree, Today, 03:41 AM
          4 responses
          13 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by traderqz, Yesterday, 09:06 AM
          5 responses
          34 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by guillembm, Today, 11:25 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X