When coding a strategy, is there a way to set a maximum allowable number of positions? Say I'm using a trend following strategy and using a pyramiding system to add more positions on pullbacks. Is there a way to make the strategy only add a certain number of additional positions? My goal is to do this in order to keep from becoming over-leveraged.
Many thanks.