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)
Hello Fat Tails. Yesterday afternoon I noticed that the visual SMA in strategy mode repainted plots a couple of times when I hit the f5 key. This morning I decided to watch the behavior of this indicator in both visual and strategy mode. I selected two times at random, took a before picture, then hit f5, then took an after picture. The indicator in visual mode seems to be working fine but in both instances, the plots in strategy mode changed. I've attached the before and after pictures. The first instance = before1 and after1. Second instance = before2 and after2.
Best Regards
Chuck
Can you help answer these questions from other members on NexusFi?
The critical point is the transition from historical to real-time data, i.e. the moment you open or reload the chart. If you press F5 you replace real-time data with historical data. Also you shift the hybrid bar - the bar which NinjaTrader builds from historical and real-time ticks to the right.
If you observe differences after pressing F5, there can be three reasons:
(1) With F5 you replace real-time data with historical data. Historical bars are built from 1 tick, while real-time bars are built from many ticks, as many ticks as were observed during the bar period. For historical data bars that have the same time stamps will be aligned, while for real-time data this may be different. The NinjaTrader timestamps have a 1-second resolution. On historical data you lose sub-second information.
(2) NinjaTrader is event driven. As historical data is built from 1 tick, you know that the bar is complete, when this 1 tick is detected. This means that you can perform the indicator calculations with every tick and display the values on the chart. Real-time bars are built from many ticks. Although it would be theoretically possible for some bar types to count the ticks or the volume, you will not know for all bar types, when they are completed.
-> for minute bars you will have to wait for the first tick of the next minute to be able to perform calculations for the previous minute bar
-> for range bars you have to wait that the range is exceeded to calculate the value for the previous range bar
This means that you have a 1-tick delay on real-time data, which is due to the inherent logic of some bar types or NinjaTrader architecture, which is event driven.
When you press F5 in some cases the lag created by real-time data can be reduced an the indicator may show 1 tick earlier on historical data.
(3) Your observation relates to the hybrid bar. When you press F5 NinjaTrader inserts an artificial historical tick and then completes the bar with real-time ticks. This additional historical tick "irritates" the multi-timeframe indicator and it inserts an additional "node", which can be seen on the chart.
Once you press F5 the additional "node" will disappear, and eventually the lag will be reduced a little.
Conclusion:
You just need to accept that at the intersection of historical and real-time data there is a little "node", where the indicator deviates from its real value. If you do not press F5 all the time, this interface between historical and real-time data moves away and leaves the chart on the left side.
In one-tick-correction mode, the indicator will not be affected by the issues (1) and (2) as it is allowed to repaint one tick and can therefore compensate the lag on real-time data.
The issue(3) related to the transition bar remains, although I tried to reduce the impact of the artificial historical tick inserted. Your charts do not show a significant deviation except for the last bar, which is difficult to judge as it is incomplete.
In general the indicator should not change values when used in one-tick-correction or visual mode, maybe with the exception of the transition bar between historical and real-time data.
Hello Fat Tails. Thanks for the quick response. I figured that this was due to Ninja Trader limitations. I'm not a programmer but I think I understand the meat of what you were trying to tell me. If I understand you correctly this little aberration will correct itself once the next node appears?
I've attached another example of a recent before and after picture using the one tick correction mode. As you can see this difference is more dramatic. From where I am sitting it just appears that if one is depending on this indicator to trade real time, the only reliable mode is the visual mode.
Maybe it is related to the way Renko bars are built. This can induce an additional lag. Personally I would not try to calculate moving averages from range or Renko bars, as you cannot really know how NinjaTrader builds them. If you use SMA from minute, tick or volume bars and apply them to other chart types you should be fine.
For example I have made tests calling the indicator, when it was loading range or Renko bars. There were huge errors, so you cannot call the indicator when these bar types are selected. The next version will take that into account as well.
By the way, if they are errors from retrieving a value for the hybrid bar, this error should correct itself over 3 secondary bars, as you have selected a bar period of 3.
Can you please help me understand ... lag and errors can occur when a SMA is from or applied to range or Renko bars? If the SMA is from minute, tick or volume bars and applied to a range or Renko, would one still experience possible lag and errors?
Any SMA lags by itself. That was not your question.
If you have a multi-timeframe indicator, it calculates an indicator values from a secondary bar series and this indicator value is only displayed when the next bar of the primary series closes. For simplicity, let us imagine a 2-min and a 3-min bar series. The 3-min bar series is used to calculate the indicator value. The result is then transferred to the 2-min bar series, which is visible on the chart for display.
Now imagine a common bar close at the full hour (60 can be divided by 2 and 3), for example at 8:00 AM. Then the next indicator value from the 3 minute bar series will be available at 8:03 AM. But there is no 2-minute bar closing at 8:03 AM, so this result will be transferred to the 8:04 bar of the visible bar series. The display of the result therefore lags by 1 minute.
When you plot an indicator from a different timeframe on your chart, you have the choice between
-> adding a secondary bar series to your chart (1)
-> adding a multi-timeframe indicator to your chart (2)
(1) will create no additional lag, but may cause non-equidistant bar spacing
(2) will maintain equidistant bar spacing, but create an additional lag
You simply can't have it all!
Due to the architecture of NinjaTrader the indicator may temporarily deviate a bit at the intersection of historical and real-time data. But this is just one point on your chart, i.e the moment when you connect. The VisualSMA and VisualEMA let you identify this point via the color of the nodes, as each node will show whether it is a historical or a real-time node.
Otherwise it is best to calculate the VisualSMA from minute, tick or volume charts. This is particularly true if you want to access the indicator in strategy mode from within a strategy.
Hello Fat Tails. I'm hoping you can add this request to your "to do" list. For a while now I have been experimenting with Zach's Multi MA Price Channel on a 12 tick renko chart (see image1). I'm not necessarily interested in all the ma types but would simply like to have a "MTF Visual SMA With Bands" indicator using the parameters and plots in image2.
Thanks for your consideration.
Actually this would not be too difficult to do, but I still have too many other construction sites.
The easiest approach would be to make the VisualSMA callable. I actually have a version that can be called by another indicator. The only problem is the repainting of the distance between the last value and the prior node. So if the indicator is called by another indicator
-> the calling indicator needs to repaint synchronously with the VisualSMA, to do so a parameter needs to be transmitted specifying the number of bars being repainted
-> calling the VisualSMA will only work, if the latter loads minute, tick or volume bars (not possible to call it when it loads range or Renko bars), this is due to the NinjaTrader architecture
Sorry, I still need to update a lot of other indicators as well.