Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Samples/Examples market analyzer indicators

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

    Samples/Examples market analyzer indicators

    Hi ,
    I am wondering if there are any samples/examples of market analyzer indicator source codes that i can refer to?

    thanks

    #2
    Hello a_c123,

    Thanks for your post and welcome to the forums!

    For the Market Analyzer (MA), most indicators provide (make public) an output plot and this is usually available to the MA. When the plot is added in the MA, the MA is then able to display the current bar value of the plot. Depending on the plot output value you may or may not be able to use the MA cell conditions. For example if you add a 20 period SMA indicator to the MA, all that you could do is to show the output value (per instrument). You would not be able to use cell conditions because the value of the plot is likely to be very different instrument to instrument. In the case of an indicator like a stochastic, you would be able to configure the cell condition logic to react to, for example, when the stochastic line (%D or %K) are above or below a certain value and this would fit for all instruments because the stochastic has a known range regardless of instrument.

    One typical use of writing code for the MA specifically is where you have a logic condition that you wish to know. An example would be with two moving averages where they cross over. While this is easy to see on the chart, you cannot visualize it on the MA. To be able to see a cross over condition on the MA you would want to output from the indicator a value that can be used in the MA. For example when the moving averages cross you could output a +1 for a cross above, a-1 for cross below or a 0 (zero) when no cross. In the MA then you would use the cell conditions to react to a +1, -1 or 0 condition, for example a cell condition where -1 means that the cell background color changes and the text "CrossBelow" is shown, 0 means that there is no color or and/or no text and a +1 could have a different color background and different text.

    Here is a link to a reference sample for exposing indicator values that are not plots: http://www.ninjatrader.com/support/f...ead.php?t=4991

    Please let me know if I can be of further assistance.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul for your reply. In market analyzer I would like to have timestamp column for the alert/condition. Eg if i am monitoring a group of stocks to see when they cross previous day's close or high or low, i would like to have alerts sorted on timestamp column to ensure i am looking at the most recent alerts as well as know when the alert happened. Please let me know if you have any sample code that shows this.
      thanks

      Comment


        #4
        Hello a_c123,

        Thanks for your reply and clarifying your goals.

        I'm not sure that you would be able to use timestamps as you have described however another method would be to have the indicator pass the number of bars since the crossover occurred. In the indicator coding you could use MRO (Most Recent Occurance) and have it return the number of bars since the last crossover.


        As far as recording when the crossover condition occurred you have a couple of options, one is to add Alert() method to your indicator code to output to the alerts window when the condition occurred. Alternatively you can in the Market Analyzer add an alert condition that will also output to the Alerts window. With the alerts window, you can then have a complete list of what alert and when that is timestamped and can be saved/exported. http://www.ninjatrader.com/support/h...rts_window.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Paul.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by samish18, 05-04-2024, 12:20 PM
          2 responses
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
          31 responses
          100 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by reynoldsn, 05-04-2024, 02:34 PM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Vietanhnguyen2hotmailcom, 05-03-2024, 10:29 AM
          5 responses
          41 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by truepenny, Today, 03:45 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_RyanS  
          Working...
          X