Add Optimal F to your TradeStation strategies using this code. This package includes the documentation and the EasyLanguage ELD file, which contains the Optimal F function as well as a sample trading strategy.
Optimal F was developed by Ralph Vince and was one of the tools Larry Williams used to turn $10,000 into over $1,000,000 in a single year.
The code is fully disclosed and open-source. It is a great example of accessing trade statistics and using arrays in TradeStation.