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

Ploting Example Added With Data #612

Merged
merged 26 commits into from
Jun 13, 2023
Merged

Conversation

DrChandrakant
Copy link
Contributor

Please Review Notebook Work

Notebook Fill For Dochian Channel Indicator
CSV Data Used For Ploting
MACD Histogram With Color Gradient
Example of Ichimoku Cloud With Fill between and All Parameters
@DrChandrakant
Copy link
Contributor Author

All Notebook Revised and Updated

@DrChandrakant
Copy link
Contributor Author

All Notebooks were Updated. Kindly Review The Changes

@DanielGoldfarb
Copy link
Collaborator

I just tested and ran these notebooks locally on my pc. They demonstrate nicely how to use addplot and fill_between in the call to mpf.plot() to make nice looking indicator plots. I want to merge this Pull Request to include them in the repository.

However, these examples will be more valuable if they included at least some indication as to where the data came from, for the various columns actually used in these examples.

This indication could be as simple as including one or more markdown cells that describe either (1) where the data can be obtained, or (2) where the user can learn how to calculate the data. Alternatively, if you used your own code to obtain the columns, then perhaps include the code in the notebooks.

It would be nice also to include a reference to where users can learn more about each type of indicator demonstrated here.

Here are the columns used: Tenkan-sen, Kijun-sen, Chikou_Span, Senkou_Span_A, Senkou_Span_B, MACD_12_26_9, MACDh_12_26_9, MACDs_12_26_9, DCU_10_15, DCM_10_15, DCL_10_15

Copy link
Contributor Author

@DrChandrakant DrChandrakant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You for Reviewing. I'm Updating the File With the Method To Obtain Ichimoku Cloud Technical

Formula For Dochian Channel Calculation Updated
Formula For MACD Indicator Calculation
@DanielGoldfarb
Copy link
Collaborator

For what security is the price data in examples/data/t_data.csv?
Is that simulated data? (it goes into the future).

@DrChandrakant
Copy link
Contributor Author

It is historical data of security name'NSE:TCS'.

@DanielGoldfarb
Copy link
Collaborator

@DrChandrakant Thank you. Just out of curiousity, can you explain to me why _15 is part of the names of DCU_10_15, DCM_10_15, and DCL_10_15. I understand the the _10 relates to the period used, but what does _15 signify? Thanks.

@DrChandrakant
Copy link
Contributor Author

Single-input indicators:
For single-input indicators, the column name is formed by appending the indicator's name with an underscore (_) followed by the name of the input column. For example, if you calculate the Simple Moving Average (SMA) indicator on the "close" column row length, the resulting column name will be "sma_length".

Dual-input indicators:
For dual-input indicators, the column name is formed by appending the indicator's name with a double underscore (_ _) followed by the names of the input columns in alphabetical order. For example, if you calculate the donchian indicator using the 'df["HIGH"] and df["low"] columns with row length, the resulting column name will be "DCM_df["HIGH"][Length]_df["LOW"][length]".

Supertrend is a technical analysis indicator used in financial markets to identify the direction of a stock's price movement. It is a popular trend-following indicator that helps traders and investors determine whether to enter or exit a trade. The Supertrend indicator is based on the average true range (ATR) and uses two input parameters: the period and the multiplier.
The Awesome Oscillator is a popular technical indicator used by traders and analysts to identify potential buying and selling opportunities in financial markets. It is primarily used to gauge the momentum of a financial instrument and to determine the strength of a trend. Here are some ways the Awesome Oscillator can be used.
@DanielGoldfarb
Copy link
Collaborator

@DrChandrakant
Thanks. That makes sense. But it does not agree with the formula you added to the code here:

#For Calculation Dochian Channel
period = 10
df['DCU_10_15'] = df['High'].rolling(period).max()
df['DCM_10_15'] = df['Low'].rolling(period).min()
df['DCL_10_15'] = (df['DCU_10_15`] + df['DCL_10_15']) / 2

Is it possible you meant something more like this?:

df['DCU_15'] = df['High'].rolling(15).max()
df['DCL_10'] = df['Low'].rolling(10).min()
df['DCM_10_15'] = (df['DCL_10'] + df['DCU_15']) / 2

Thank you for contributing these three examples to mplfinance. Ideally, I would like that the input file contain only OHLCV, and to have the indicators calculated within the example. I will do the work to make that change, however I want to be sure that I understand the formulas. Presently I feel a little confused regarding the Dochian Channel, as just described above.

Thank You For Valuable Suggestion. I think its better to avoid confusion Dochian Channel Formula Updated
@DrChandrakant
Copy link
Contributor Author

Thank you for your suggestions. I Have Revised the Code and Suggestions Adopted. Some New Indicators Added Please Take Look.

@DanielGoldfarb
Copy link
Collaborator

Thank you for adding the calculations to all of the notebooks as requested above.

I just realized that one notebook still does not have the calculation in it: That is the Indicator_supertrend.ipynb. Much appreciated if you can please add that. Thank you.

Suptrend Calculation Updated as an Inline Function
@DrChandrakant
Copy link
Contributor Author

Thanking You, Suptrend Calculation as an inline Function Updated.

Use Scatter addplot
Color change 100SMA Line after Cross Over
Alphatrend Indicator With Inline Calculations
Feature Request: New style called binance-dark matplotlib#614
Indicator Parabolic SAR Added
@DanielGoldfarb
Copy link
Collaborator

@DrChandrakant

I have to ask you to remove, or undo, two of the last three commits. The Parabolic SAR is fine. It calculates Parabolic SAR from simple OHLC data (as I would like all of the examples to do), and it is consistent with the purpose of this Pull Request: to present several examples of Indicators.

However the other two commits should each be their own separate PR:

  • the binancedark theme should be a separate PR.
  • the highlighting mav prices on the y-axis should also be a separate PR.

The above two should not be together as one PR, but two new PRs separate from this one.

I have a lot or PR's to review and test, and I hope to finish this one in the next few days. Please make the above requested changes. Thank you.

@DrChandrakant
Copy link
Contributor Author

Reverting Last Changes

Deleted Binancedark
As Per Suggestion All Exam Update
- Used OHLCV Data Only
- Calculation Within Notebook
- Detail Description Calculation
- Details mplfinance function used
@DanielGoldfarb
Copy link
Collaborator

@DrChandrakant
Thank you for the latest commits. Very good. Please don't make any more commits to this PR without asking me first. I am going to make a few small changes and then, hopefully, merge. Much appreciated! All the best. --Daniel

@DanielGoldfarb DanielGoldfarb merged commit df73e85 into matplotlib:master Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants