Jump to content
  • 0

How is EMA50 and EMA200 being calculated on the charts as it looks non-standard?


mgwuk

Question

I downloaded historical data from the US 500 via the API. I verified that the 320 data points I downloaded match the UI on the graph. When I calculate the EMA50 and EMA200 on my dataset correctly I get a different result to what is shown on the IG charts. I thought it may a precision difference that could cause the small difference I'm seeing but I checked that and that looks okay to me. I checked my dataset and it's clean without missing data.

I'm doing my calculation in Python as follows:

# Apply the exponential moving averages
df_ta["ema50"] = df_ta["close"].ewm(span=50, adjust=False).mean()
df_ta["ema200"] = df_ta["close"].ewm(span=200, adjust=False).mean()


Just for interest sake I checked the SMA50 and SMA200 and they are an exact match.

There is something strange about the EMA calculation on the charts. Does anyone know what it is?
 

Link to comment

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

Hi mgwuk

Glad you posed this question as I have been trying for the last number of weeks to ask the same question of IG and am still waiting on a response. Did you come up with an answer?

My workings below on how to calculate EMA clearly does not match IG Chart using IG data and EMA indicator and the method provided by IG which can be calculated as follows for example for EMA21:
 
where:
k = smoothing parameter which is 2/(lookback period+1) or for EMA21 is 2/(21+1) = 0.0909091
EMAt = previous candle EMA21 value
 
Both formulae below result in same value
EMA21 = k * close price + (1-k) * EMAt
or
EMA21 = EMAt + k *(close price-EMAt)
 
The following values in blue are taken from the 5 minute interval Nikkei 225 Japan Cash from IG charts looking at EMA21.
 
You can see from the table below the difference in calculated values using the above formula versus the IG chart data.
 
Sydney Time
Close Price
calc_EMA21
IGchart_EMA21
11/04/2024 1:25
39282.2
11/04/2024 1:30
39252.2
11/04/2024 1:35
39192.2
11/04/2024 1:40
39167.2
11/04/2024 1:45
39172.2
 
Obviously, the chart data is using a different formula. The SMA values align perfectly as you found.
 
Edited by Bliz_23
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • Asian stocks rose on Tuesday, tracking gains on Wall Street ahead of comments from several Federal Reserve officials later in the day. The Reserve Bank of Australia kept interest rates on hold at 4.35%, as expected, but warned inflation risks remain. This led traders to cut back bets on an RBA rate cut this year, though the Australian dollar was little changed. Ebbing concerns over European political turmoil also boosted market sentiment. Futures for European stock indexes were higher after gains on Monday. The dollar edged up ahead of US retail sales data, pressuring the euro and pound. The Chinese yuan remained near 7-month lows on mixed economic data from China pointing to a need for more policy support. With multiple Fed speakers on tap, investors are looking for clues on the US rate outlook after last week's Fed decision, with around 45 basis points of cuts priced in for the rest of 2024.
    • ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   Elliott Elliott Wave Technical Analysis TradingLounge (1D Chart)   Greetings, Our Elliott Wave analysis today updates the Australian Stock Exchange (ASX) with NATIONAL AUSTRALIA BANK LIMITED - NAB . We determine that NAB will continue to push higher with wave iii-grey of wave (iii)-orange. We updated our Trade Recommendation (Long Trade with NAB) yesterday. NAB is opening up quite good profits in today's trading session.   ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   Elliott Wave Technical Analysis   ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   1D Chart (Semilog Scale) Analysis Function: Major trend (Minute degree, navy) Mode: Motive Structure: Impulse Position: Wave iii-grey of Wave (iii)-orange of Wave ((v))-navy Details: The short-term outlook suggests wave (iii)-orange is unfolding to push higher.   Invalidation point: 34.48   ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   Elliott Wave Technical Analysis TradingLounge (4-Hour Chart) ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   Elliott Wave Technical Analysis ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   4-Hour Chart Analysis Function: Major trend (Minuette degree, orange) Mode: Motive Structure: Impulse Position: Wave ((3))-navy of Wave iii-grey of Wave (iii)-orange Details: The short-term outlook shows that wave (iii)-orange is opening to push higher, it is subdividing into waves i,ii,iii-grey and waves ((1)),((2)),( (3))-navy. We updated our Trade Recommendation (Long Trade with NAB) yesterday. NAB is opening up quite good profits in today's trading session. Invalidation point: 34.83   Conclusion:   Our analysis, forecast of contextual trends, and short-term outlook for ASX: NATIONAL AUSTRALIA BANK LIMITED - NAB   aim to provide readers with insights into the current market trends and how to capitalize on them effectively. We offer specific price points that act as validation or invalidation signals for our wave count, enhancing the confidence in our perspective. By combining these factors, we strive to offer readers the most objective and professional perspective on market trends.   Technical Analyst: Hua (Shane) Cuong, CEWA-M (Master’s Designation). Source : Tradinglounge.com get trial here!  
    • Elliott Wave Analysis TradingLounge Daily Chart, ChainLink/ U.S. dollar(LINKUSD) LINKUSD Elliott Wave Technical Analysis Function: Counter Trend Mode: Corrective Structure: Double Corrective Position: Wave Y Direction Next higher Degrees: Wave ((II)) of Impulse Wave Cancel invalid Level: 8.498 Details: Wave (II) is equal to 61.8% of Wave (I) at 8.86 Level ChianLink/ U.S. dollar(LINKUSD)Trading Strategy: ChainLink overall is still in the period of correction. In the position of wave (II) with a double corrective pattern, the view is therefore for a short-term pullback before rising again in wave (III), waiting for the correction to complete to rejoin the uptrend. ChainLink/ U.S. dollar(LINKUSD)Technical Indicators: The price is below the MA200 indicating a downtrend, The Wave Oscillator is a Bearish Momentum.   Elliott Wave Analysis TradingLounge H4 Chart, ChainLink/ U.S. dollar(LINKUSD) LINKUSD Elliott Wave Technical Analysis Function: Counter Trend Mode: Corrective Structure: Double Corrective Position: Wave Y Direction Next higher Degrees: Wave ((II)) of Impulse Wave Cancel invalid Level: 8.498 Details: Wave (II) is equal to 61.8% of Wave (I) at 8.86 Level ChainLink/ U.S. dollar(LINKUSD)Trading Strategy: Chainlink overall is still in the period of correction. In the position of wave (II) with a double corrective pattern, the view is therefore for a short-term pullback before rising again in wave (III), waiting for the correction to complete to rejoin the uptrend. Chainlink/ U.S. dollar(LINKUSD)Technical Indicators: The price is below the MA200 indicating a downtrend, The Wave Oscillator is a Bearish Momentum.   Technical Analyst : Kittiampon Somboonsod Source : Tradinglounge.com get trial here!
×
×
  • Create New...
us