Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Analyzer use my customized indicator issue.

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

    Market Analyzer use my customized indicator issue.

    I would like add my customized indicator into Market Analyzer. I did it yesterday with Chris's help.

    but the issue is Market Analyzer only take the last current bar plot value. My indicator calculate when OnBarClose, The plot value got calculated only the previous bar closed. So the last current bar plot is always n/a. Please see the attached screenshot.

    The plot value of the previous bar are calculated by my indicator but I am not sure how to let Market Analyzer take offset plot bar value.

    Is there any way Market Analyzer can take previous bar value? Please help. thanks

    #2
    Hello LadGta2018,

    Thank you for your post.

    You would need to have the indicator assign that previous value to a plot for the previous value to be shown. So something like:

    MyPreviousValue[0] = MyCalculatedValue[1];

    Where MyPreviousValue is a plot and MyCalculatedValue is whatever the indicator has calculated for the previous bar.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Originally posted by NinjaTrader_Kate View Post
      Hello LadGta2018,

      Thank you for your post.

      You would need to have the indicator assign that previous value to a plot for the previous value to be shown. So something like:

      MyPreviousValue[0] = MyCalculatedValue[1];

      Where MyPreviousValue is a plot and MyCalculatedValue is whatever the indicator has calculated for the previous bar.

      Please let us know if we may be of further assistance to you.
      Hi Kate,
      Thanks for your quick response. I tried the code "MyPreviousValue[0] = MyCalculatedValue[1];". It didn't work.

      According to Calculate.OnBarClose, the last bar is not close yet, so the code wont be triggered anyway. Please clarify it. thanks

      Comment


        #4
        Hello LadGta2018,

        Thank you for your reply.

        Did you replace those example variables with your own Plot series variable and calculations variables as I explained in my previous post? That code would not be usable as is.

        When calculating OnBarClose, the latest values will be for the bar previous to the currently forming bar.

        If you can provide an example of what you've tried, that would be helpful.

        I'm attaching a working example of an indicator that will plot the close of the previous bar that may make this more clear.

        Please let us know if we may be of further assistance to you.

        Attached Files

        Comment


          #5
          Hi Kate,

          Thanks for your quick response.

          Yes, I did replace the code.

          And I just tried your example. the example didn't work either. Please see the screenshot.

          When I move to the last bar, the plot output showing "n/a".

          Comment


            #6
            Hello LadGta2018,

            Thank you for your reply.

            This would be expected for an indicator that processes OnBarClose. There will be no data for the currently forming bar until that bar closes and the next bar opens. If you need to get information for the currently forming bar, you would have to set the indicator to calculate OnEachTick or OnPriceChange. I do apologize for misunderstanding your initial inquiry - I interpreted it to mean you wished to get the data for the bar previous to the most recently closed bar.

            Please let us know if we may be of further assistance to you.

            Comment


              #7
              Hi Kate,

              Thanks for your support. Now we are in the same page.

              I don't have tick data, so OnEachTick is not my option. I do can switch to OnPriceChange. But somehow Market Analyzer still didn't give the correct output. And my indicator has a lot calculation, so I would rather stay with OnBarClose way.


              Back to my question, is there any way Market Analyzer can take previous bar plot value? not just the last bar plot value? which is the best group to ask about Market Analyzer? Thanks



              Comment


                #8
                Hello LadGta2018,

                Thank you for your reply.

                is there any way Market Analyzer can take previous bar plot value
                When running OnBarClose, the value returned will be the value for the bar that most recently closed, not from the currently forming bar. If you wish to have the Market Analyzer display the value of the bar prior to the most recently closed bar, you would need to take the approach outlined in my example. If this is not what you are referring to by "take previous bar plot value", please clarify.

                Please let us know if we may be of further assistance to you.

                Comment


                  #9
                  Originally posted by NinjaTrader_Kate View Post
                  Hello LadGta2018,

                  Thank you for your reply.



                  When running OnBarClose, the value returned will be the value for the bar that most recently closed, not from the currently forming bar. If you wish to have the Market Analyzer display the value of the bar prior to the most recently closed bar, you would need to take the approach outlined in my example. If this is not what you are referring to by "take previous bar plot value", please clarify.

                  Please let us know if we may be of further assistance to you.
                  Thanks Kate, your example worked for Market Analyzer.

                  I modified my indicator. it only worked for some instruments. not sure why.

                  Basically Market Analyzer doesn't work well for me. it is not user friendly.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  597 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  343 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  103 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  556 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  555 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X