Skip to content

For using markers, these references may help: #565

New issue

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

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

Already on GitHub? # to your account

Closed
ptiwari2407 opened this issue Oct 23, 2022 · 2 comments
Closed

For using markers, these references may help: #565

ptiwari2407 opened this issue Oct 23, 2022 · 2 comments

Comments

@ptiwari2407
Copy link

ptiwari2407 commented Oct 23, 2022

    For using markers, these references may help:

https://matplotlib.org/3.1.0/gallery/lines_bars_and_markers/marker_reference.html

https://matplotlib.org/3.2.1/tutorials/text/mathtext.html (note sections on numbers and arrows)

https://stackoverflow.com/questions/44726675/custom-markers-using-python-matplotlib

https://stackoverflow.com/questions/14324270/matplotlib-custom-marker-symbol

Originally posted by @DanielGoldfarb in #97 (comment)

Somehow this does not seems to work in mpf ?

def sell_signal_plot(df):
ap0 = [
mpf.make_addplot(df['BB_up'], color='b'),
mpf.make_addplot(df['BB_low'], color='b'),
mpf.make_addplot(df['Kelt_low'], color='r'),
mpf.make_addplot(df['Kelt_up'], color='r'),
mpf.make_addplot(df['BB_mid'], color='grey'),
mpf.make_addplot(df['sell_s'], color='r', marker= '$6$')

]
mpf.plot(df, type='candle', addplot=ap0, style='yahoo')

In the above function, there are lines being drawn? Here is a snapshot for your reference. df['sell_s'] has values 0 and 1.

@ptiwari2407
Copy link
Author

Mpf-marker-error

@ptiwari2407
Copy link
Author

Hello, i solved the problem. Here is an interesting fix.

df['sell_s'] = df.apply(sell_signal, axis=1)
df['sell_s'] = df['sell_s'] * df['High']
df['sell_s'] = df['sell_s'].apply(lambda x: np.nan if x==0 else x)

This answer of yours on Stack-overflow helped.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant