Skip to content

Specific values for stop loss #338

Answered by polakowo
ironstone05 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ironstone05, most arguments can be specified as arrays. Both sl_stop and tp_stop are percentages of the stop entry price. The default stop entry price is close, meaning even though you ordered at the current opening or any other price, the threshold will be computed from the current close (because if the stop is being hit in the same candle, vectorbt wouldn't know whether it's after the entry - we have no intra-candle data - so we use close just for safety). You can change that with stop_entry_price (see enum https://vectorbt.dev/api/portfolio/enums/#vectorbt.portfolio.enums.StopEntryPrice), also globally in vbt.settings['portfolio']['stop_entry_price']. Now, you need to bring both st…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ironstone05
Comment options

@ironstone05
Comment options

@polakowo
Comment options

@cryptoliciousdev
Comment options

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