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)
Playing around with anaSuperTrend and some SuperTrend strategies here in this forum, I have noticed that some of these anaSuperTrend versions are a bit different in the plotting and arrow trend signaling.
Would someone be able to tell me the differences between the anaSuperTrend and the anaSuperTrendM11 in reference to the calculations behind it?
I know that the M11 version allows user to change the stop-line and stop dots appearances, but when using the same parameter settings, as you can see from the attached pic, the stop-lines are plotted differently and thereby on a few instances, there can be a arrow trend change on one version, while the other version stays with the current trend.
Your observations are exact. Let me try to explain the differences.
Technical Analysis was originally performed by chartists on daily charts
Most of the indicators were not designed for day trading, but were originally applied to a printed chart, once the market had closed. So the chartist would perform the calculation of the formula once and write down the result. The best book that I have seen to show how this was done is Welles Wilder's "New Concepts in Technical Trading Systems".
Why it is ridiculous to use these indicators on tick-by-tick real-time data
Let us take the example of a Bollinger Band. It uses the standard deviation over a lookback period, which is a relatively complex calculation. For these calculations it includes the current value of price. So with every incoming tick you need to recalculate the standard deviation. What you get in return is a band that moves away from price, when price approaches it. So if you check price against that Bollinger Band, you essentially get a feedback loop with negative feedback.
Conclusion: Recalculating Bollinger Bands tick by tick causes a high CPU load which creates negative feedback. In short this is mathematical nonsense.
How to implement indicators correctly?
For use with real-time, you want a low impact indicator, which serves the purpose. For the Bollinger Bands it would be good enough to replace the standard deviation StdDev(20)[0] with the StdDev(19)[1] and calculate this only once when the first tick of the new bar is detected. The chart below shows the original Bollinger Band (orange) and the modified Bollinger Band (red). Teh difference is that during a news release the red bands will not trigger a few thousand calculations of the standard deviation and freeze your trading software.
The worst coding example that I have seen is the VWAP, as is calculates the standard deviation back to the beginning of the session with each incoming tick. Freeze guranteed, if you use it CalculateOnBarClose = false.
Now what about the SuperTrend M11?
The SuperTrend uses the median and the average true range to calculate the stop bands. As seen for the Bollinger Bands it is neither necessary nor helpful to include the current value of price to calculate the bands. Therefore the stop value is calculated from the median of the last period anaMedian(MedianPeriod)[1] and the true range of the last period ATR(ATRPeriod)[1]. This makes it robust and possible to use it in CalculateOnBarClose = false mode,which is necessary if you want to get the alerts in real-time. The SuperTrend M1 only had the ATR calculated one bar back, but still calculated the median with each incoming tick.
So it is just a starting point to replace all the nonsense indicators with indicators that are adapted for use with real-time data. The difference between the two indicators is negligible. What you have to do though, if you compare the SuperTrend M11 to the SuperTrend M1: You need to reduce the Median period of the Supertrend M11 by 1 to come as close as possible.
WOW, Outstanding answer.
Thank you kindly for your time in clarifying how these indicators are calculated and the HISTORY behind.
This is another example that once we are thoroughly educated in a particular "tool," we can make an educated and mathematical decision on whether it would beneficial to our "Lives.".
I have few questions for you guys, especially for @Fat Tails, because he is the creator of the indicator.
I currently use (actually just discovered it this morning) anaSuperTrendMod, where could i find anaSuperTrendM11 ?
What is the meaning of the gray and red line from anaSuperTrendMod, and how should they be used?
Is there a possibility to disable the plot for them?
It is one of the questions of coding indicators how to improve speed and reduce calculations to allow for more efficient use in real-time. The Supertrend M1 calculates the volatiliy measure only once, when the first tick of the bar is triggered. The median, …