Recently i am working on an indicator called "Supertrend", however i am a hard time to get the right value.
BASIC UPPERBAND = (HIGH + LOW) / 2 + Multiplier * ATR BASIC LOWERBAND = (HIGH + LOW) / 2 - Multiplier * ATR FINAL UPPERBAND = IF((Current BASICUPPERBAND < Previous FINAL UPPERBAND) and (Previous Close > Previous FINAL UPPERBAND)) THEN Current BASIC UPPERBAND ELSE Previous FINALUPPERBAND FINAL LOWERBAND = IF((Current BASIC LOWERBAND > Previous FINAL LOWERBAND) and (Previous Close < Previous FINAL LOWERBAND)) THEN Current BASIC LOWERBAND ELSE Previous FINAL LOWERBAND SUPERTREND = IF(Current Close <= Current FINAL UPPERBAND ) THEN Current FINAL UPPERBAND ELSE Current FINAL LOWERBAND
And i write an excel to calculate manually on Hang Seng Index 1-Day data https://docs.google.com/spreadsheets/d/1Q_TCVa6uV-Go2nX6rsI2_a-jTyZFfGI42R8Wb0_FI-c/edit?usp=sharing
The data source is from investing.com https://www.investing.com/indices/hang-sen-40-historical-data
The supertrend data is correct as long as to row 129(counting from the bottom), but in row 129(30-Jul-19), the supertrend value is starting to be wrong
My questions on this
1) I see two different calculations on ATR, one using ATR(t-1) * 13 + ATR(t) / 10, and the other one is using simple average of last 10
When using the simple average, the supertrend value of the bottom rows(144-130) works out as the same as investing.com's graph, but the ATR is not the same as investing.com.
However, when switching back ATR calculation to ATR(t-1) * 13 + ATR(t) / 10, the ATR value align with investing.com's data, but the supertrend data is wrong.
Looking forward to have a clear clarification on supertrend formula and how to calculate it manually and accurately(same as the value as investing.com, no matter what ATR you use, but please just specified)