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

tp_stop with accumulate gives wrong result #711

Open
Yak0vkaSup opened this issue May 25, 2024 · 0 comments
Open

tp_stop with accumulate gives wrong result #711

Yak0vkaSup opened this issue May 25, 2024 · 0 comments

Comments

@Yak0vkaSup
Copy link

Hello,

When i have multiple entries and after i want to exit with tp_stop i think that it calculates tp_stop from only the last position and not the volume and average entry prices of all previous positions. So DCA strategy with exits only on take profits doesnt work at all.

image

portfolio = vbt.Portfolio.from_signals(
price,
entries,
tp_stop=take_profit_pct,
size_type="value",
size=100,
init_cash=10000,
accumulate='addOnly'
)

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