Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
what bar value is used to calculate the sma indicator?
Collapse
X
-
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)
Alan P.NinjaTrader Customer Service
-
Comment
-
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
-
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
-
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
-
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.Alan P.NinjaTrader Customer Service
Comment
-
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.Alan P.NinjaTrader Customer Service
Comment
-
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment