vectorbt
vectorbt copied to clipboard
Is it possible for Vectorbt to enter the market in batches?
Is it possible for Vectorbt to enter the market in batches?
For example, if the initial cash is $1,000, buy $500 when the stock price crosses MA5 for the first time, buy another $500 when the stock price falls to MA10, stop loss and exit when the stock price falls to MA20, and take profit and exit when there is a 20% profit.
Thank you.
Everything is possible, you can either represent your strategy using signals and then pass those signals to from_signals (with accumulation enabled if you want to increase/decrease a position), or use from_order_func to place orders dynamically.
This issue is stale because it has been open for 90 days with no activity.