Can you use bt.optimize for things like trade size, stop loss size, margin, etc.? #799
CadeHalcyon
started this conversation in
General
Replies: 1 comment 5 replies
-
Yes, it is possible to use everything. You can also optimize any of those parameters. All the info is in the documentation. For example, in the strategy, if you open a new trade you can use the following: self.buy() in order to set a stop-loss and a trade size you should use: self.buy(tp={your take profit price value}, size={your trade size}) More info here: |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry if this has already been answered, I have trawled through the previous discussions and could not find a definitive answer... essentially, is it possible to define things like stop loss size, trade size (e.g. as % of balance), leverage/margin etc. Class variables and use them with bt.optimize? Thanks
Beta Was this translation helpful? Give feedback.
All reactions