Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OHLCV data challenge with mplfinance #422

Open
manniokim opened this issue Jul 23, 2021 · 21 comments
Open

OHLCV data challenge with mplfinance #422

manniokim opened this issue Jul 23, 2021 · 21 comments
Labels
question Further information is requested

Comments

@manniokim
Copy link

manniokim commented Jul 23, 2021

Ask anything you want about mplfinance usage, project philosophy and/or priorities, or anything else related to mplfinance.

hello, I am new to data processing with pandas and python programming generally, I am working with a large crypto ohlcv dataset from a database. I need to answer some questions from the dataset, questions like

1)which day of the week shows the greatest change in price?
2)which hour of the day shows the greatest change in price?
3)looking at weekly data, to what extent can the Thursday - Sunday price change be predicted based on the movements from Monday - Wednesday?
4)looking at weekly data, does the weekday pricing data provide any predictive clues to what will happen by the end of the weekend?

so far, I've been able to extract the data, set timestamp as index and tried to resample the data,plot the data in mplfinance but I have two challenges, I can't present the data as days of the week eg. Thursday and the picture from the plot doesn't answer my questions.is there a way for me to aswer this questions using the timestamp as it is? I tried the alternative of creating a new data frame with just the variables I need (open, high,low,close,volume,date, time, day of the week) but this data won't plot in mplfinance. I would appreciate any help with this issue
. Thank you

@manniokim manniokim added the question Further information is requested label Jul 23, 2021
@DanielGoldfarb
Copy link
Collaborator

@manniokim
Hi. Thank you for contributing your issue to mplfinance. I have some idea what you are trying to accomplish, but it is not entirely clear to me. Also, while helpful, it is very tedious to go through in detail all of the images of your notebook.

Would you be willing to post your notebook, as it is in these pictures (that is, with both inputs and outputs) to a github repository or gist and give me access to it? That way I can possibly clone it and see if I can solve the issue you are having.

Thanks again. All the best. --Daniel

@manniokim
Copy link
Author

@manniokim
Hi. Thank you for contributing your issue to mplfinance. I have some idea what you are trying to accomplish, but it is not entirely clear to me. Also, while helpful, it is very tedious to go through in detail all of the images of your notebook.

Would you be willing to post your notebook, as it is in these pictures (that is, with both inputs and outputs) to a github repository or gist and give me access to it? That way I can possibly clone it and see if I can solve the issue you are having.

Thanks again. All the best. --Daniel

@manniokim manniokim reopened this Jul 23, 2021
@manniokim
Copy link
Author

@DanielGoldfarb I have posted the notebook and given you access to it. thank you.

@DanielGoldfarb
Copy link
Collaborator

@manniokim
Thanks. I see the notebook now. I will try to take a look in the next day or two. All the best. --D.

@DanielGoldfarb
Copy link
Collaborator

@manniokim ... Can you please add please add the file list.csv to the repository? Thanks.

@manniokim
Copy link
Author

@DanielGoldfarb done, thank you

@manniokim
Copy link
Author

Hi @DanielGoldfarb checking in

@DanielGoldfarb
Copy link
Collaborator

DanielGoldfarb commented Jul 26, 2021

@manniokim
I still don't see list.csv in the repository. I can see the results of it in the notebook, which is helpful. And I believe that I can give you some ideas as to how to answer your questions. But I think I may be able to give you a more complete answer if I run your notebook and play around with the data some. However if I clone the repository and run your notebook, I think it will fail on pd.read_csv('list.csv') because I don't see the csv file in the repository. (You need to git add list.csv and then git commit).

I am hoping later today (a few hours from now) to have some time to look into this and respond.

@manniokim
Copy link
Author

@DanielGoldfarb I'm sorry for the oversight. I have now added it

@manniokim
Copy link
Author

@DanielGoldfarb checking in

@DanielGoldfarb
Copy link
Collaborator

DanielGoldfarb commented Jul 30, 2021

I have access to the csv file, everything I need ... I just haven't had time with other projects. Hope to look at this early next week.

@manniokim
Copy link
Author

Thank you

@manniokim
Copy link
Author

@DanielGoldfarb Hi, I was able to find way around using Vlines. I was also able to answer the questions , however I still need help answering the question with the data as an aggregate not singly. I appreciate if you can spare some time to guide me.

@manniokim
Copy link
Author

@DanielGoldfarb I have invited you as collaborator on the new repo

@DanielGoldfarb
Copy link
Collaborator

@DanielGoldfarb I have invited you as collaborator on the new repo

@manniokim Okim, very nice job on the notebook, very organized and clear.


@DanielGoldfarb Hi, I was able to find way around using Vlines. I was also able to answer the questions , however I still need help answering the question with the data as an aggregate not singly. I appreciate if you can spare some time to guide me.

So just to clarify what you mean by "answering the question with the data as an aggregate not singly" ... I see, for example, your first question "Which day of the week shows the greatest change in price?" you have answered "The day that shows the greatest change in price is the 9th of June which is a Wednesday with an opening price of 37500 and a closing price of 36,200."

Based on this, I would assume by "as an aggregate not singly" you mean that you want to compare all Mondays in aggregate, to all Tuesdays in aggregate, to all Wednesdays, in aggregate, etc. Is this correct?

If so, then the question becomes, how best to aggregate them to make sense of the answer? For example, we see that one particular Wednesday has the absolute largest change, but maybe there are two or three Tuesdays that have then 2nd, 3rd, and 4th largest changes. If that were the case, then even though one Wednesday has the largest change of all, we see that large changes are more common on Tuesdays. Is that the type of "aggregate" question you are trying to answer?

@manniokim
Copy link
Author

manniokim commented Aug 6, 2021

@DanielGoldfarb thank you. yes please, that is the type of aggregate question I'm trying to answer. eg. is it more profitable to trade on say Tuesdays than on Thursdays ? apologies for not framing the question clearly.

@manniokim
Copy link
Author

@DanielGoldfarb Hi, checking in

@DanielGoldfarb
Copy link
Collaborator

@manniokim
Okim, the ohlcdata repository that contained "list.csv" is gone. Can you please add "list.csv" to the new "bitcoin_analysis" repository? Thanks. --Daniel

@manniokim
Copy link
Author

@manniokim
Okim, the ohlcdata repository that contained "list.csv" is gone. Can you please add "list.csv" to the new "bitcoin_analysis" repository? Thanks. --Daniel

so sorry about that, I have just done that

@DanielGoldfarb
Copy link
Collaborator

@manniokim ... Thanks

@Blessvskp
Copy link

Blessvskp commented May 26, 2023

The issue raised by @manniokim is extremely relevant and very important to forex, options , commodity and stock traders. The additional time intervals required by intraday traders are: 3m, 5m, 10m, 15m, 30m, 1Hr, 2Hr, 4Hr. This is required for time frame analysis. Rather if the out put of time interval display and live 1m display can be in a single chart frame, it will be an icing on the cake!

I am not sure if the issue is completely answered and settled. If settled, I shall be glad to go through the solution.

The possible way is to find the date on which the swing in price is greatest or smallest and then by using calendar module, find the day of that date; though I am not completely sure! This requires additional coding.

Dr. Sai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants