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

Equity is not updating on the final tick when trade_on_close=True ? #304

Open
Adrian-LA opened this issue Apr 10, 2021 · 0 comments
Open

Comments

@Adrian-LA
Copy link

Expected Behavior

Equity should be adjusted on the last tick to the close price of the final bar if a position is open.

Actual Behavior

Equity does not update on the last tick, the last two values in the equity array are the same, but only if trade_on_close=True

Steps to Reproduce

  • trade_on_close set to True
  • strategy results in open position at the very end
  • strategy I used: simple SMA crossover with n1 = 10; n2 = 30. Historical data was the last 5 years in daily bars of MSFT

Additional info

Noticed the discrepancy when comparing to my own little program.
https://i.gyazo.com/a794c733395d9de06440b94bf6f7a700.png
The above array is from my code. I double checked and I believe that my code does it correctly and the fact that the last value repeats is suspicious.

  • Backtesting version: 0.?.?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant