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)
I used xcMovAvg to draw EMA(20) under range 4. The line of the multi time frame seems to lag a little bit behind EMA(20) under range 4. What causes the lag?
The lag is a result of the way NinjaTrader processes bars internally (design flaw). For a multi-timeframe indicator NinjaTrader first processes the primary bars (the bars that can be seen on the chart). In a second step all secondary bar series (those loaded via the indicator) are processed.
Your chart shows the special case, where the primary bars and the secondary bars are identical (4 range bars). In that case when the primary bars are processed, the indicator value is calculated from the last available value from the secondary bar series. This is the prior bar, as the current bar of the secondary bar series has not yet been processed. Therefore the multi-timeframe indicator is lagging by 1 bars.
There are some workarounds possible
-> For historical bars you can access the current bar of the secondary bar series as the value is already known, it is possible to eliminate the lag for historical bars. The chart below shows the VisualEMA which has no lag when compared to the regular EMA.
-> For real-time bars you may paint back (override) the lagging value after the current bar of the secondary bar series has been processed. I have integrated this feature with my multi-timeframe indicator and called it "one-tick correction". "One-tick correction" should be avoided when calling the indicator via a strategy. Therefore the indicator comes with a strategy mode (1 bar lag with real-time data) and the "One-tick correction" mode, which repaints 1-tick back and shows no lag.