A Substitute for GetStrategyName that works.

by Bill Brower on May 12, 2016 | Categories: Uncategorized |

A Substitute for GetStrategyName that works.

Beginning with TradeStation 2000i and carried along in versions of TS5.0 through TS8.6, there was a command that allowed the programmer to access the name of the strategy that was running in a chart window. That command was getstrategyname. This was particularly useful to traders that wished to perform strategy testing and save the test results say from an optimization with custom code to a file. For reasons that have never been revealed, TradeStation decided to abandon this command and disabled it. So it was that for several years there was no way to access the name of the strategy from within Easylanguage.

With the introduction of TS9.0 and Object Oriented Easylanguage (OOEL), programmers began to have access to some of the methods and properties of classes and libraries. One of these classes is called elsystem.AnalysisTechnique which is the container for all Analysis Techniques applied to a chart. One of the properties of this class is Name and as you can see from the EL Dictionary definition in the screenshot below, that property will return the name of the Analysis Technique. It is not even necessary to preface that property with the full namespace and class string. You can see this easily enough by adding the following line of code to your indicator or strategy. Then look in the Print Log window for the output.

Once Print(Name);