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

    • His mention of C3.ai, with its focus on predictive maintenance and smart meter management, highlights how AI isn't just improving operational efficiency but also creating new growth opportunities. Anderson also points to Microsoft’s AI-enhanced cloud services as another example of AI setting the stage for future business models. For investors, it’s less about immediate profitability and more about the long-term potential of AI.
    • XRP supporters have noticed a significant shift in the cryptocurrency's price following the SEC’s recent legal actions. As the situation unfolds, understanding these dynamics is crucial for investors. SEC’s Appeal: A Shock to the Market On Thursday, the U.S. SEC announced its intention to appeal favorable rulings from the Ripple lawsuit that concluded a few months ago. By Friday, this intention became official as the SEC submitted applications to the U.S. appellate court. This news sent shockwaves through the XRP market, leading many investors to sell off their tokens, which caused the price to drop sharply. XRP’s Recent Price Movements Price Drop After the SEC Announcement On October 2, just before the SEC’s appeal news broke, XRP reached an intraday high of $0.6058. However, by October 3, the price plummeted to $0.5101, marking a 15.79% decrease. Interestingly, despite the SEC's appeal being registered on October 4, XRP showed signs of recovery.  As of writing this article XRP Price was trading at 0.54 With 1.375 increase in last 24 hours as per Coinpedia markets data For a more detailed analysis of XRP's potential price trajectory, be sure to check out our comprehensive XRP price prediction article. Comparing the 2020 Lawsuit Impact In December 2020, the situation was markedly different. When the SEC initially filed its lawsuit against Ripple, XRP's price dropped dramatically. On December 20, XRP was valued at $0.5678, but by December 23, following the lawsuit announcement, it had plummeted to $0.2214, a staggering 61% decline. The situation worsened as more exchanges began delisting XRP. By December 29, the price had fallen to $0.1748, nearly 70% lower than its pre-lawsuit price. Resilience and Future Predictions Despite the recent turmoil, XRP’s ability to recover has sparked optimism among its supporters. Some market analysts, including Bobby A, believe that the current legal developments may present a “sell trap.” He predicts XRP could reach $4.23 soon, emphasizing that macro charts remain bullish. Furthermore, there are suggestions that XRP could potentially rise to $6 in the near future. After hitting a low of $0.17 during the 2020 lawsuit, XRP surged by 1,021% to $1.96 by April 2021. If a similar rally occurs from the recent low of $0.5101, it could see prices climbing as high as $5.72, with the possibility of reaching $6 by January. As the SEC's legal actions continue to unfold, XRP's resilience offers hope for future price rallies. Investors are encouraged to stay informed about market developments.
    • Cardano (ADA) is one of the most talked-about cryptocurrencies, with its price currently sitting at $0.3556. But what does the future hold for ADA? Let’s break down the key predictions and market developments in this ADA price prediction article. Optimistic Price Predictions Potential Rise to $1 by 2024: Some analysts are predicting that Cardano could reach $1 by the end of 2024, showing strong potential for growth. 17% Gain Predicted by November: CoinCodex forecasts that ADA could rise by 17% and hit $0.4249 by November 6, 2024. This is backed by the fact that 63% of the past month’s trading days were "green," signaling positive market momentum. Concerns and Bearish Predictions Max Keiser's Bold Prediction: Max Keiser stirred controversy with his prediction that ADA could lose 90% of its value compared to Bitcoin in the next six months. This pessimistic outlook has raised concerns among investors. Price Volatility: Over the last six months, Cardano’s price has dropped by 39.93%, reflecting significant volatility. However, if bulls manage to push the price above $0.43, ADA could see a rise to $0.49, an increase of 25%. Community and Rumors Charles Hoskinson Denies Rumors: Recently, rumors surfaced that Cardano’s founder, Charles Hoskinson, sold 1 billion ADA during the last bull market. Hoskinson quickly shot down the speculation, calling it false and stating, “It didn’t happen. People just lie. It’s how the internet works now.” Generosity Joke Gone Wrong: The rumors began when Cardano supporter Jason Appleton jokingly asked if a helicopter seen in a Fox News clip belonged to Hoskinson, hinting at the costs of his charitable efforts. This comment spiraled into baseless claims that Hoskinson had cashed out during ADA’s peak price of $3.60. Future Developments and Roadmap Leios Upgrade: Cardano’s new roadmap includes the Leios upgrade, which will greatly improve the network’s scalability. This could attract more users and enhance ADA’s long-term potential. Large Transactions Spike: In September 2024, Cardano saw a spike in large transactions, with a monthly high of 5,070 transactions. This indicates growing interest in the platform, despite recent price fluctuations. While the short-term future of Cardano remains uncertain, its strong community and upcoming developments offer reasons for optimism. Investors will need to keep a close eye on ADA’s price movements and the broader market trends as we head into 2024.  
×
×
  • Create New...
us