Navigation: Realtest Script Language > Script Sections > Strategy Section >

Special Strategy Types

 

 

 

There are two alternative ways to define a strategy: as a Benchmark or as a Template. All three of these strategy types are defined the same way and support all the same elements. The only difference is in which keyword is used to declare them. For an example of a script that uses all three types, see mr_sample_benchmark.rts.

A Benchmark strategy is run and its stats are calculated exactly as if it was a regular strategy. It has its own set of stats and will appear among the strategies shown in stats graphs. The only difference is that the stats of a benchmark are not included in the combined results. One use of a benchmark strategy is to plot a simple buy-and-hold equity line for visual comparison with your own strategy. A more advanced usage would be to define a basic version of a strategy which the actual strategy can refer to.

Template strategies serve to prevent the need to copy and paste elements that are common to several strategies in a script. Template strategies are not "run" in a backtest. In older versions of RealTest, there was a single template strategy called "Defaults". This has now been replaced with support for multiple named templates.

To define a template strategy, simply declare it as, for example, "Template: base". To include the elements from that template in another strategy (or template or benchmark), add the statement "Using: base" to the strategy. To include more than one template, list them separated by commas, as in "Using: base1, base2, base3".

When a strategy uses a template, it inherits all the elements defined in that template (and any others that the template uses).  It can then optionally replace some of those elements by declaring them within the strategy.

 

 

 

 

Copyright © 2020-2021 Systematic Solutions, LLC