Skip to content

How to set the buy and sell signal in the graph #145

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

Closed
edwardLui opened this issue Sep 17, 2020 · 3 comments
Closed

How to set the buy and sell signal in the graph #145

edwardLui opened this issue Sep 17, 2020 · 3 comments
Labels
invalid This is not a (valid) bug report

Comments

@edwardLui
Copy link

How to set buy and sell signal in the graph, here is the example..

Expected Behavior

image

@kernc
Copy link
Owner

kernc commented Sep 17, 2020

Can you clarify your question? I don't think I get what you want exactly.

To use a signal-based strategy, you can use backtesting.lib.SignalStrategy as shown in one of the tutorials.

@eervin123
Copy link
Contributor

I don't want to put words in @edwardLui Edward's mouth, but I believe he is looking for the option to add a "buy triangle" (green up triangle) at time of purchase, and a "sell triangle" (red down triangle) at time of sale on the price chart in the bt.plot() method.

This is nice, but I have come to appreciate the tractor beams @kernc created as the default as seen in the image below.

image

@kernc
Copy link
Owner

kernc commented Oct 1, 2020

Was also thinking of adding trade entry markers to the P&L chart:
Untitled
But we also have to watch out not to overwhelm Bokeh with too many objects, as with a couple thousand candles/trades the plot quickly becomes unruly and slow.

@kernc kernc closed this as completed Oct 26, 2020
@kernc kernc added the invalid This is not a (valid) bug report label Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This is not a (valid) bug report
Projects
None yet
Development

No branches or pull requests

3 participants