Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Indicator displaying different data on market analyzer

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

    Custom Indicator displaying different data on market analyzer

    Hello,

    I have a custom made daily indicator that displays very different data on the market analyzer page than when it is on a chart. No changes are done in terms of parameters and the numbers of bars loaded is not important ( as it is non cumulative ).

    Have you ever seen /had that case before ? If yes by what was it caused ?

    If not I can post the indicator......

    Thank you

    #2
    Hello gabga100,

    Can you verify that your CalculateOnBarClose setting for the charts and the Market Analyzer are the same? The chart uses this set to 'true' while the Market Analyzer loads the indicator with default to 'false'.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hello,

      Yes I have checked very carefully that, alle the settings are exactly the same.

      I enclose two screenshots as well as the indicator ....as you can see the settings are the same but the results very different ( -0.469 VS 20.73 )

      Please let me know.
      Attached Files

      Comment


        #4
        Hello gabga100,

        Thanks for the screenshots and the NinjaScript file.

        When I imported RemoveVolume it gave me an error when you are referencing barsType, are you using a different reference file for the use of barsType or did you mean to use PeriodType?
        JCNinjaTrader Customer Service

        Comment


          #5
          Oh yes , I am sorry , I forgot that this piece was sitting in a diffferent indicator

          You can just past this after declarations
          .....
          #region Global Enums
          public enum barsType {Minute, Tick, Second}
          #endregion

          Thanks again !

          Comment


            #6
            Hello gabga100,

            After placing the code inside of your Indicator I am able to get it to compile but only getting it to Plot a value of 0.

            Taking a quick look at your code it looks like vals.Count is always equal to 0.

            Do you have a newer version of your indicator that you are using?
            JCNinjaTrader Customer Service

            Comment


              #7
              Hello,

              This is probably because you are choosing a data series of 1 minute instead of 1 day in the market analyzer ( being an indicator computing a daily average of volume based on smaller bars , anything below 1 day as data series will throw 0) . If you choose 1 day as data series in analyser and the same other parameters I chose , you will get the same results i did, and you will notice that for some mysterious reason ..... results in analyser are different ....

              Comment


                #8
                I did the testing in the same way you have in your screenshot and was still having 0 display on some instruments but not others. Another setting that seems to have made the two values match between my chart was if I set the bars loaded to be the same. By default the MA is only using 50 bars. This made it match for the ES 03-13

                However no matter what settings I used the INTC displays 0 on the chart.
                LanceNinjaTrader Customer Service

                Comment


                  #9
                  Hello. Today , I have the same as you, on market analyzer it throws a 0 while on the chart it computes correctly (using exact same parameters). ...see screenshot enclosed......

                  You had the exact same behaviour correct ? ( computes correctly on chart but not on alayser 0.....)

                  Are you able to find why ? I think you are in the best position to find out quickly ......

                  Manny thanks , your help is really appreciated on this ......
                  Attached Files

                  Comment


                    #10
                    Hello gabga100,

                    It might be returning 0 because it does not have a valid plot, so by default the Market Analyzer window is going to return a price value which is why before you seen it show up as a value of 20 which would be the price of the stock.

                    You may want to add a check the value of your plots like in the following thread.


                    Also, you will want to set the number of bars loading on your Market Analyzer column to the number of days you are loading on your chart for example by default a daily chart is going to be set to 365 days so you would want to then right click inside of the Market Analyzer, select Columns, select your Indicator column, and then since it is a daily chart change the "# of bars to look back" to 365.
                    JCNinjaTrader Customer Service

                    Comment


                      #11
                      Hello, I have done the consistency test with no issue......all bars have a value

                      In addition, the indicator is independent of the number bars loaded because it computes a number for every day independently of the previous day..... somehow value are simply different ....

                      Are you able to debug it with a more sophisticated tool ( just pick a stock for which you obtain a difference ) or do you need me to do it ?

                      I am pretty convinced there is a fundamental reason why it does not work that you might correct for further versions .....

                      Many Thanks and have a great week-end

                      Comment


                        #12
                        Hello gabga100,

                        The setup of the Market Analyer window for loading a Indicator is different but OnBarUpdate() should be processed the same. There is a display difference between the Market Analyzer window and the Chart for the plots, the Market Analyzer window will display the last price if there is not a valid plot.

                        While we cannot debug your code. Quickly glancing at your code and seeing some output i see that the Vals.Count is < 2 which is clearing vals.

                        If you believe something is in error let me know a specific reproducible scenario and I will be glad to look into this.
                        JCNinjaTrader Customer Service

                        Comment


                          #13
                          Hello,

                          I have used your code example, and added Print(VolumeAverage.ContainsValue(0)) to check whether there is a plot value each time ....and there is (only gets true in the output window)., so I think we can discard this possibility,

                          I have however noticed that when I change the #bars to look back , the value of the indicator changes .....which is unexpected since it is value is reset daily and independent on when the data series started ( non cumulative) ....playing with it, I have noticed that when I set the value above 500 then the indicator in anlayzer matches what plotted ...... would you have any idea why ?

                          As this indicator computes is a daily indicator based on one minute bars ( which sum is reset daily), do you think this might have an influence ? What is #bars to look back ?
                          Attached Files

                          Comment


                            #14
                            This tells us that there are not enough bars to arrive at your calculation for the plot When this occurs, the market analyzer is going to replace the desired plot value with the current bar price.

                            The # of bars to load is similar to the number of days to load on the chart and controls how many bar objects are loaded for your indicator.

                            Although you're loading this on a Daily bar, your indicator appears to be using minute data to calculate as well. There are 1440 minute bars in 1 day bar, which explains why you need such as high # of bars to load to arrive at your calculation.
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Ok ....so we can say problem solved ...... however, do not you think the behaviour is a little bit unexpected ?

                              As the indicator is a daily indicator (made by smaller minute bar) , I would have assumed that the minimum number of bars would refer to the main and principal type of bar (daily) ......

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ZenCortexCLICK, Today, 04:58 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post ZenCortexCLICK  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              172 responses
                              2,279 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Irukandji, Yesterday, 02:53 AM
                              2 responses
                              17 views
                              0 likes
                              Last Post Irukandji  
                              Started by adeelshahzad, Today, 03:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post adeelshahzad  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Working...
                              X