-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
wrong logic of buy and sel #49
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
Comments
The green up arrow is not a buy signal, but rather an end point marker of a market-long (upwards) and profitable (green) trade. Note, |
Great, thank you kernc |
Then, how do I identify the buy/sell signals in the plot ? |
The dotted lines indicate duration of trades and the PL triangles closing trades' success. There are no other visual indicators showing trades entering, nor order placing. It's very simple to devise something yourself: class MyStrategy(Strategy):
def init(self):
# Shows buy/sell signal as a scatter plot. Init to all-NaN.
self.signal = self.I(lambda: np.repeat(np.nan, len(self.data.Close), scatter=True)
def next(self):
...
# on some condition
self.buy()
def buy(self, *args, **kwargs):
self.signal[-1] = 1 # On buy, input 1 instead of existing NaN
super().buy(*args, **kwargs) |
Expected Behavior
I found the buy and sell signal was wrong.
please check out the attachment.
Actual Behavior
wrongly P/L -1.538
because the trade is a win trade
Steps to Reproduce
1.
2.
3.
Additional info
The text was updated successfully, but these errors were encountered: