Skip to content

final PnL in pips incorrect? #269

Answered by kernc
jjphung asked this question in Q&A
Mar 5, 2021 · 3 comments · 4 replies
Discussion options

You must be logged in to vote

Not sure it's related, but you likely should reset total_pips_gained in init():

    def init(self):
        self.total_pips_gained = 0

Let me know if that does anything.

I was not able to find self.data.pip anywhere in the codebase on how it is determined.

It's here:

@property
def pip(self) -> float:
if self.__pip is None:
self.__pip = 10**-np.median([len(s.partition('.')[-1])
for s in self.__arrays['Close'].astype(str)])
return self.__pip

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@jjphung
Comment options

@kernc
Comment options

@jjphung
Comment options

Answer selected by jjphung
Comment options

You must be logged in to vote
1 reply
@jjphung
Comment options

Comment options

You must be logged in to vote
0 replies
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