Skip to content

How to set a profit target with a trailing stop at the same time? #345

Answered by kernc
Raymond-Peng asked this question in Q&A
Discussion options

You must be logged in to vote

You are not returning anything from your nd_low and nd_high.

Also be aware of the availability of .s accessor.

def nd_low(s, n):
    return s.rolling(n).min().shift()

nday_low = self.I(nd_low, self.data.Close.s, self.entry_period)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Raymond-Peng
Comment options

Answer selected by Raymond-Peng
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants