exp Metastock 8.0 takes all these things into consideration. (1) You can set the number of trades.1,2,3,4, to what ever. (2) You can set the percent of portfolio to use in each trade. (3) Draw down. (4) Etc.
WLD also knows these things because he uses WealthLab
If you can program, maybe you should spend a little money in Metastock and/or Wealth Lab