-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
Calculation of Stop price #539
Comments
It uses stop price by default, that is, for long positions entry price x (1 + tp_stop). By setting stop exit price to “price” it will execute using default order price, which in your case is close. |
I tried with stop price also. I think issue is here is that the entry and exit happens on the same candle (Candle1). Please confirm if this is the issue, and if yes, then how can this be solved? |
If you executed using the close price, then it cannot happen at the same bar. But if you executed using open price, then probably, in such a case the stop will be resolved at the next bar (and there's no workaround to this because only one order per bar is supported, you can write your own logic using flexible order functions). |
understood this part. In my case, I am passing a custom price as the first parameter of the from_signals (this is based on some logic).
in this case, the TP takes price of next close only in all the stop_exit_modes. I was wondering if the entry price x (1 + tp_stop) will be calculated to see if the entry price and close price has sufficient difference to accommodate the TP |
This issue is stale because it has been open for 90 days with no activity. |
Hi, I have been trying to implement TP/SL using the vbt.Portfolio.from_signals. I passed all the required prices in the parameters
Issue is that even after applying tp_stop as 0.25%, my best trades come out as 3%. Sharing the two OHLC below to explain better:
Entry happens at 19530 (Candle1.Close) and exit happens at 20185 (Candle2.Open). Net returns - 3.3%
I went through the documentation also to understand the possible values of stop_exit_price. But in all the cases, it either pick ups the Open or Close of the next candle. Is it not possible for the framework to calculate the TP price and put that as exit price? That will ensure that no trade goes beyond the mentioned tp_stop
The text was updated successfully, but these errors were encountered: