For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
5min data from yahoo
-
Hi everyone!
I'm currently trying to create a trading-strategy using 5-min data formatting as below in a CSV file downloaded from Yahoo:
2022-05-17 09:00:00+02:00
However when I feed the data the output when running the script is:
2022-05-17 23:59:59.999989
I'm aware that a similar question have been asked on other posts, but none of the solutions provided in the other posts have solved the issue.
The code for my datafeed is as follows:
data = bt.feeds.YahooFinanceCSVData( dataname='/Users/anderslindstrom/Python/quant_1.1/algo_trader/pullback_strategy/dax_5min.csv', timeframe=bt.TimeFrame.Minutes, dtformat='%Y-%m-%d %H:%M:%S', compression=1 reverse=True)
Would really appreciate any suggestions and help! :D
-
2022-05-17 23:59:59.999989
This happens to every datetime??
I always use bt.feeds.PandasData , it can work on yfinance downloads as well.
-
@borutf WOW! Using feeds.PandasData worked, thank you so much! :D