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)
Is there a way to display a higher timeframe Moving Average onto a lower timeframe? I've been trying to do this withing NT, but can't find a way to do this. If anyone knows the answer on how to get this done, it would be much appreciated.
Can you help answer these questions from other members on NexusFi?
Definitely,
initialise a indicator script,
get the price series for the higher timeframe,
plug the series into the sma function,
save said script and overlay.
Yes, two instruments with different timeframes on the same chart will work. It's easy in NT to define the same instrument as a second (or third, etc.) with a different timeframe, then tie any indicator to that new instrument. The thing I've never liked about this method is, depending on how large a disparity exists between the smaller and larger timeframe, even a simple MA will appear to stair step rather than be smooth. That's because the higher time frame (even if invisible for its prices) will plot its indicator at its own periodicity, with gaps between its (hidden) bars.
Another option you might is using a multiple of the lower and higher timeframes in a new MA on your existing chart.
For example, the multiple between a 1-minute and 5-minute chart is 5. So if you're trading a chart with a 1-minute timeframe and want to see the 5-minute 20 period SMA trend, dropping a 100 SMA on your 1-minute chart works.
In a test I ran now with the ES, this method was off by 2-3 ticks (2787.98 on a 20 SMA plotted on 5-min vs 2787.31 on a 100 SMA plotted on the 1-min). That should be close enough if you're basing trades on moving averages, imho.
Since I don't know your trading style, the simple arithmetic trick is the only thing I'm pointing out here.
Select "Data Series" from the top menu of your chart. Add a second entry (Instrument) being the higher timeframe. Select Transparant for the bars/candles, select Panel = 1 and Price Marker Visible = No. Select OK to save & close the window.
Select "Indicators" (top menu) and add MA indicator. Change "Input series" by selecting the second Data Series you just made.
you don't say which NT you are on but NT7 has an indi called "Visual EMA Multi- timeframe". That is what it does...I run a 1 and 5 minute EMA on my small tick or range charts.
Craig
Until you make the Unconscious conscious, it will direct your life and you will call it Fate...
Let us assume that you wish to display an hourly SMA(20) on a 5-minute chart. Then there are four basic options to do so.
(1) The timeframe multiplier that needs to be applied to a 5-min chart to obtain a 60-min chart is x12. Therefore you may simply use a SMA(12 x 20) = SMA(240) on your 5-min chart to approximate the SMA(20) calculated from hourly bars. This is the easiest of all options, takes the lowest amount of CPU and also easily applied to systems trading.
However, you will not get an exact SMA(20), but a good approximation. For all practical purposes this optioin is good enough. As a sidenote, this will not work for other types of moving averages with the exception of the EMA. For other moving averages you may not use the timeframe multiplier to adjust the lookback period.
(2) Your second option is to add a secondary bar series of 60-min bars to your chart, set the 60-min bars to transparent such that they become invisible, and then use the 60-min bars as input series for your SMA(20). You will now have an hourly SMA(20) displayed on your chart.
(3) It is possible to develop an indicator that calculates synthetic bars by compounding the lower timeframe. For example you may calculate a synthetic 60-min bars from 12 consecutive 5-min bars and then calculate the SMA from the synthetic bars. The advantage of this approach is that it does not produce any lag. I have coded such a set of moving averages for NinjaTrader 7, but not yet converted them to NinjaTrader 8.
(4) The last option is to develop a multi-timeframe indicator that loads a secondary bar series of 60-min bars. The indicator would then display the SMA values calculated from the 60-min bars on the chart. This approach is a bit tricky to code, as the few values for which the higher timeframe SMA is calculated needs to be interpolated. Also this method will produce a 1-tick lag in Calculate.OnEachTick, but a 1-bar lag in Calculate.OnBarClose. Because of the lag I would only use this method, when the other methods cannot be used. I have coded a such a SMA for NinjaTrader 7, and called it Visual SMA. You will find it in the download section.
Comparing the 4 approaches:
(1) Easiest solution, low CPU load, no lag - but approximation limited to SMA, EMA, TMA and also limited to time-based, tick and volume charts.
(2) Accurate moving average, low CPU load, no lag - but distortion of chart bars through empty spaces (bad distortion for NT7, mild distortion for NT8)
(3) Accurate moving average, no lag - but difficult to code, higher CPU load for calculating synthetic bars, limited to time-based, tick and volume charts.
(4) Accurate moving average - but difficult to code, up to 1 bar lag, higher CPU load, not working with Renko bars.
Nota: When you compare a SMA(240) on a 5-minute chart with a SMA(20) on a 60-minute chart, they are only comparable when you select the bar median as input series. In case that you select the close, the SMA(240) has a lag of 10 bars, which may be eliminated by reducing the bar period by 5 units from 240 to 235. This is sort of fine tuning the first variation. Please find attached a chart that compares a SMA(20) which is added to invisible secondary 60-min bars to a SMA(235) which is calculated from the chart bars which are 5-min bars. The approximation is good enough for all practical purposes.
ES 06-20 (5 Minute) _ ES 06-20 (60 Minute) 2020_04_13 (17_48_39)
If one use a multiple of the lower time frame for the higher time frame (for instance 3m & 15m or 5m & 60m) there is no distortion (at least not in NT8).
With NinjaTrader 8 there is no distortion for minute, second, tick and volume bars. There will be a minor distortion for range and renko bars. Altogether the distortion is weak and not comparable to the problem of "non-equidistant bar spacing" which occured with NinjaTrader 7.
Actually, I only had coded the VisualSMA, VisualEMA etc. because of the non-equidistant bar spacing problem. As there is only a minor distortion that can be observed with NinjaTrader 8, conversion of VisualSMA, VisualEMA etc. has a low priority and I have not yet been able to do it.
I have read what is discuss here, previously, and have some questions, if you all can help to enlighten me please?
I see that we display higher timeframe SMA on 5min chart, onto a 1mio chart.
May I know if it is possible to display higher timeframe minute chart onto Tick chart?
I am trying to do a 15min SMA onto a 1600 tick chart, for ES contract, and using Ninjatrader 8. Using the simple method of adding Higher timeframe in Data Series etc.
( Sorry not a technical guy, hence using simple methods )