Skip to content
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

different output for same strategy #732

Closed
bolka64 opened this issue Aug 31, 2022 · 1 comment
Closed

different output for same strategy #732

bolka64 opened this issue Aug 31, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@bolka64
Copy link

bolka64 commented Aug 31, 2022

Hi everyone,

I'm trying to backtest some strategies. I added EMA 200 to the "init" function. I didn't want to use it in the "next" function, just wanted to see it in output plot.
When I add EMA200 to my "init" function some parameters like 'Return [%]' are changed .
I don't know why this happened.
I put my jupyter notebook file in the ZIP attached file.
Q.zip

@kernc
Copy link
Owner

kernc commented Sep 6, 2022

Duplicate of #674.

Your EMA(200) delays trading by the first 200 bars while it's "gathering" values:

# Skip first few candles where indicators are still "warming up"
# +1 to have at least two entries available
start = 1 + max((np.isnan(indicator.astype(float)).argmin(axis=-1).max()
for _, indicator in indicator_attrs), default=0)

I sense this results in a different Return you see.

@kernc kernc closed this as completed Sep 6, 2022
@kernc kernc added invalid This is not a (valid) bug report duplicate This issue or pull request already exists and removed invalid This is not a (valid) bug report labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants