Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent Plot unless value changes

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

    Prevent Plot unless value changes

    I currently have a custom harmonic indicator with a custom DataSeries. How do I prevent this custom DataSeries from being plotted unless a new price "D" has been generated?

    My intent is to use this indicator in the market analyzer which scan hundreds of instruments and return the D price of a XABCD pattern.

    #2
    Hello,
    Thank you for the question.

    I would like to know, are you referring to preventing the DataSeries from plotting in a chart or are you asking how to filter rows that the DataSeries does not = X in the Market Analyzer?

    If you are trying to prevent the Market Analyzer from showing rows, you could potentially use the Filter condition in the MA. It depends on the value you are getting out of the indicator, if this is a basic number like a 1 for on and 0 for off this would be very easy, if it is a range you may have to make a few conditions.

    Can you provide some more details on this?

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

    Comment


      #3
      I am not trying to filter and this is a DataSeries for the market analyzer.

      Right now the last price D of the pattern is constantly reprinted (verified with output window). What I am trying to do is only plot/print the value once until a new price pattern is identified.

      For example, if there is no valid pattern, output (plot) -1 so that I could then filter out the instruments which == -1.

      Comment


        #4
        Hello,

        Thank you for the clairification.

        There are two ways to do this, they are both exactly the same except the first you need the indicators original source code.

        Essentially what you will need to do is create a custom plot for the MA specifically.

        This plot would need to be set to -1 at the beginning of every OnBarUpdate so in the MA it will report a -1 if there is no change.

        You would need to declare a variable that will hold the existing value of the indicator.

        In the OnBarUpdate you would need to check if the current indicator value is == to the stored value, if it is not == to the stored value you would set the plot to 1 to create a signal. The next time OnBarUpdate runs it would return the plot to -1.

        This would be one way of doing this, you may need to change the logic around because if this were to run with CalculateOnBarClose = false it would only show the row for a split second. If it was COBC = true, it would show for how long it takes for the next bar to close.

        If you do not have the original source, like i said the process would be the same but you would instead create a new indicator that reads your harmonic indicator value and compares it. You would then load the New indicator into the MA column rather than the harmonic indicator.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        75 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Started by Stanfillirenfro, Today, 07:23 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by FitSpressoHonest, Today, 09:14 AM
        0 responses
        2 views
        0 likes
        Last Post FitSpressoHonest  
        Started by Davide999, 05-18-2023, 03:55 AM
        4 responses
        557 views
        1 like
        Last Post kcwasher  
        Started by rexsole, Today, 08:39 AM
        2 responses
        8 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X