Hi,
I am going to create a backtesting/trading system. One of my exit conditions is: If a stock is bought after 20 days, it will exit. How is the code for that?
Besides, I don’t want to set the fix number of the stock. I want to use 5% for example of the capital. How to do that?
Regards
For position size, there is an interesting topic with some code snippets: Dynamic Position size
How to exit after n bars:
Exit after (n) days
Exit after 10 bars?
Hi Nicolas,
Thanks for the reply. I wonder where can I find the documentation of ProBacktest(as PDF or HTML)?
Besides, as I use the TOTALEQUITY, I got error that this is not defined. Also the INITIALCAPITAL is not defined.