Pandas_ta.atr return "None"

 

Hi,

I tried the follow code but It didn't work correctly and it return "None" in the Atr field.

Can someone help me please?

Thanks

import pandas as pd
import pandas_ta as ta
import yfinance as yf

data = yf.download("EURUSD=X", start='2022-01-01', end=datetime.now())
data['atr'] = (ta.atr(data['High'],data['Low'],data['Close'], 14))
print(data)
Price          Close      High       Low      Open   Volume   atr
Ticker      EURUSD=X  EURUSD=X  EURUSD=X  EURUSD=X EURUSD=X      
Date                                                             
2022-01-03  1.137346  1.137592  1.128541  1.137385        0  None
2022-01-04  1.130224  1.132300  1.127345  1.130199        0  None
2022-01-05  1.128363  1.134559  1.127764  1.128541        0  None
2022-01-06  1.131350  1.133067  1.128554  1.131222        0  None
2022-01-07  1.129688  1.135976  1.129050  1.129586        0  None
...              ...       ...       ...       ...      ...   ...
2025-02-13  1.039199  1.044572  1.037926  1.039199        0  None
2025-02-14  1.046167  1.051370  1.044812  1.046167        0  None
2025-02-17  1.048922  1.050707  1.046737  1.048922        0  None
2025-02-18  1.048537  1.048647  1.044277  1.048537        0  None
2025-02-19  1.042753  1.046463  1.040366  1.045151        0  None
 
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 

We have no idea what you are on about and that does not seem like MQL5 code.

If this is about the Python, then please state it, because most of the content here is aimed at MQL, and not other languages.

However, Python questions here should be more about MetaTrader 5 Python API, and not about general Python programming.

If this is about general Python programming, then you are on the wrong forum. You should place your questions on a Python dedicated forum.

 
Fernando Carreiro #:

We have no idea what you are on about and that does not seem like MQL5 code.

If this is about the Python, then please state it, because most of the content here is aimed at MQL, and not other languages.

However, Python questions here should be more about MetaTrader 5 Python API, and not about general Python programming.

If this is about general Python programming, then you are on the wrong forum. You should place your questions on a Python dedicated forum.

Ok, thankyou.

I thougt that in this forum it was possible to post python code that work with MT5 via API.

Sorry 

 
Denis Dal #: I thougt that in this forum it was possible to post python code that work with MT5 via API.

Yes you can post such code, but the code you posted does not contain anything related to the MetaTrader Python API.