Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
AFAIK, all you need to do is add a second dataseries (daily) to your chart, then hide it, then add a SMA and select that data series as the source. I'm sure an NT user could confirm, or @Fat Tails, @cory or @Silvester17 might know a better way.
A SMA(288) cannot be the same as a daily SMA, unless the instrument is traded for 24 hours without technical breaks. For example ES is traded from 5:00 PM to 3:15 PM and then from 3:30 PM to 4:15 PM, which makes up for 276 5-minute bars. Another problem is that the SMA(276) would recalculate every 5 min, and therefore represent a rolling day, whereas the daily SMA is only calculated once per day after the close.
Daily data is only available with a few minutes of lag, therefore the daily SMA will not be available immediately after the close.
When applying a daily SMA to an intraday chart it is important to specify, what you wish to calculate the daily SMA from! This could be
-> the settlement price (needs a data supplier that gives you the settlement price)
-> the regular close
-> the full session close
The next question what you wish to display on your chart
-> the SMA calculated from yesterday's close (you can display it as horizontal line)
-> or an estimate for today's SMA based on the last traded price
Calculating yesterday's SMA
This can be either done by using daily data (close or settlement price) or intraday data (regular close or full session close). Yesterday's value of the SMA can be displayed as a horizontal line for today.
Calculating today's SMA
The problem here is that today's SMA is not known prior to the market close (either regular or full session close). Therefore today's SMA would need to be calculated from the prior closes (final values) and the last traded price (best approximation for today's expected close). The prior closes can be taken from daily data, while the last traded price is always taken from intraday data.
In the end the best solution depends on what you look for and which data feed you use.
I did not think about this option, but @trendisyourfriend is correct here. The VisualSMA can be used to produce a daily moving average from intraday data. However, there are a few prerequisites:
(1) The VisualSMA will not work correctly on charts with non-equidistant bar spacing, so you should only apply it to a chart with a single bar series.
(2) The VisualSMA loads a secondary bar series, which is used for the purpose of calculating the SMA. If you set it to 1440 min, it will load a secondary bar series with 1 bar (1440 min or less) per session. It is important to understand that NinjaTrader cuts off all bars at the end of the session. Therefore you should use a pure ETH or RTH session template and not a template with subdivided sessions. In that case the VisualSMA will display a daily SMA calcuated from the last traded price of that session.
(3) With an ETH session template you will get a SMA calculated from the full session close. With the RTH session template you will get a SMA calculated from the regular session close. If you use a complex session template with 3 subsessions per day, then you need to adapt the period of the SMA. A daily SMA(20) can be approximated with a VisualSMA(60) on a complex session template with 3 subsessions.
Below is a chart which shows the VisualSMA(20) which simulates a daily SMA. I have set the indicator to COBC = false to reflect the last traded price. The daily SMA(20) is shown as 1920.88. This is in fact the EXACT VALUE of the daily SMA(20) calculated from the full session closes at 4:15 PM Central.
If you calculate the daily SMA(20) from the settlement prices, the result is 1921.34, which is two ticks off the SMA(20) calculated from the full session closes.
a simple way would be to create an indicator with a second data series. similar to what the op posted.
with the attached indicator you can choose what time frame and period (sma). in the examples below it shows a 5 min chart with a 10 period sma from a 30 min chart and also from a 1440 min chart. for daily charts I recommend using a 1440 min chart. depending on your data supplier you might get different results with daily charts.
and if you set plot style to "hash", it should match tos pretty close