Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

what bar value is used to calculate the sma indicator?

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

    what bar value is used to calculate the sma indicator?

    what bar value is used to calculate the sma indicator [i.e.] is it the close, the median, etc?

    #2
    Hello joemiller,

    Thank you for your note.

    If you do not pass a specific series, ie use the syntax SMA(int period), close will be used.

    You can however specify a series using a syntax at the following link which takes an ISeries.


    For example,

    Code:
    SMA(High, 20)
    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      in my excel program a 200 bar sma calculation using the formula =AVERAGE(E36:E236,0) does not check with the chart calculation of the same sma. attached are images to maybe generate further dialogue to maybe help me understand and resolve resolve the issue.

      Click image for larger version

Name:	for ninja forum jan29#1.JPG
Views:	1
Size:	167.0 KB
ID:	886017

      Click image for larger version

Name:	for ninja forum jan29#2.JPG
Views:	1
Size:	336.1 KB
ID:	886018

      Comment


        #4
        Hello joemiller,

        I would confirm you are comparing identical sets of data.

        Where did you get your excel data?

        You could check that the data is the same with,

        Print(Close[0].ToString());

        And check the output window closing prices vs what you have in the spreadsheet.

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          the several years of excel o-h-l-c bar data come from my nasdaq index [symbol=nq] futures chart. it is therefore a fictitious ''continuous'' chart.

          if it is a reasonable request, please create a quick and dirty chart and excel sheet like
          that described above and test to see if the moving averages agree. i will fully understand if the request is beyond the scope of your job description.

          the chart indicator is SMA(NQ ##-## (Daily), 200)

          a typical excel program 200 bar sma calculation formula is [e.g.] cell F236 contains the formula =AVERAGE(E36:E236,0) where bar close values are in column E.

          Comment


            #6
            Hello joemiller,

            It would be a easy test on your end to print the last 20 bars of data to the output window then check them against your excel sheet to confirm you are dealing with the same data sets, I would speculate they are different. If they look the same, then print 200 and start from the beginning, see if the first 20 are the same. There are different approaches to building continuous data sets, so please start by confirming the data is correct.

            If you confirm the data is the same, please upload an excel file with just 210 data values and I will check on our end.

            I look forward to your reply.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              thanks a bunch alan

              what is the output window?
              how do i print data to the output window?

              Comment


                #8
                Hello JoeMiller,

                The easier approach may be to go to Control Center>Tools>Historical Data, then under historical data drop down on the left, find the NQ ##-## and compare those values against your spreadsheet. I have attached a screen shot of where you would reference these values.

                I look forward to your reply.
                Attached Files
                Alan P.NinjaTrader Customer Service

                Comment


                  #9
                  attached are comparisons for the first 5 days of january 2018 and for the first 5 days of january 2017.

                  the data sets match for those two time windows.

                  Click image for larger version

Name:	ninja historical data.JPG
Views:	1
Size:	37.9 KB
ID:	886032

                  Click image for larger version

Name:	excel sheet sheet.JPG
Views:	1
Size:	96.5 KB
ID:	886033

                  Click image for larger version

Name:	ninja historical data - one year ago .JPG
Views:	1
Size:	37.3 KB
ID:	886035

                  Click image for larger version

Name:	excel sheet sheet - one year ago.JPG
Views:	1
Size:	82.7 KB
ID:	886036

                  Comment


                    #10
                    Hello joemiller,

                    There is no issue with the SMA computation. I suggest opening the indicators properties and setting Calculate to on EachTick, which will include the most recent bar and perhaps could be the reason you are seeing a discrepancy.

                    I made a script which prints the last 200 closes and applied it to a ^NDX chart, then took those values in excel and used the Average function. The value match that on the chart. See attached.

                    If you would like to upload a spreadsheet demonstrating an error please do so.

                    Please let us know if you need further assistance.
                    Attached Files
                    Alan P.NinjaTrader Customer Service

                    Comment


                      #11
                      i made a quick excel spreadsheet like yours but it looks entirely different. i notice that your chart sma indicator is SMA(^NDX(Daily),200) whereas mine is SMA(##-## (Daily),200)... could that be part of my confusion?

                      can you please remotely logon to my pc for a few minutes to help me maybe identify what i am doing wrong?
                      i am really getting far behind in my work because i have spent so much time on this.

                      Comment


                        #12
                        Hello joemiller,

                        Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread and a phone number.

                        I look forward to receiving your email.
                        Alan P.NinjaTrader Customer Service

                        Comment


                          #13
                          hello alan,

                          the problem is resolved. I worked with it some more and something I did [I have no
                          idea what it was] fixed it. no need to call me, I think the issue can be closed.

                          thanks for all your help

                          cheers & peace.
                          joe miller

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Aviram Y, Today, 05:29 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post Aviram Y  
                          Started by quantismo, 04-17-2024, 05:13 PM
                          3 responses
                          25 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by ScottWalsh, 04-16-2024, 04:29 PM
                          7 responses
                          34 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by cls71, Today, 04:45 AM
                          0 responses
                          6 views
                          0 likes
                          Last Post cls71
                          by cls71
                           
                          Started by mjairg, 07-20-2023, 11:57 PM
                          3 responses
                          216 views
                          1 like
                          Last Post PaulMohn  
                          Working...
                          X