2) Creating a Simple Strategy



New Training Video! 

Click Here to see a training video of this step!


StrataSearch allows you to program your own strategies, using a scripting language similar to that used in Metastock.  The language is quite simple, essentially using a collection of true or false statements to identify whether buy and sell signals will be triggered.  This simple scripting language can be supplemented with Custom Formulas, which allow a great deal more programming flexibility, but we won't get into that here.


In this step, we'll be creating a simple strategy based on the Relative Strength Index.  We'll also be adding a supporting trading rule to the entry definition, and we'll finally configure the parameters with variables so that we can have StrataSearch test a variety of parameter sets in the strategy. 


Creating the Strategy

Adding a Supporting Trading Rule

Using Parameter Variables

Testing the Entry and Exit Strings




Creating the Strategy


To begin creating the Strategy, open the Setups > Strategy Setups menu and then click the Add button.



The first step is always to give your Strategy a name, and then to move the cursor down to the Entry String field.  We'll be using the Calculation Builder to help us create the Relative Strength Index formula, so click the Builder button directly below the Entry String field. 


The Calculation Builder window will then display:



At this point, feel free to scroll through the list of Formulas and see what's available in StrataSearch.  After highlighting any of the formulas, click the Help For Selection button to get extended help for that item.


When you are ready, select Relative Strength Index from the list, and then enter 14 for the Days parameter.  You can then click OK to transfer the formula back to the Strategy Entry String:



Next, we'll be making 2 changes.  First, we'll complete the Entry String by identifying what Relative Strength Index (RSI) value constitutes a buy signal.  And second, we'll by entering a similar Exit String that identifies the sell signal.


Using your mouse and keyboard, you can now update the Entry and Exit Strings with the following information:


Entry String: rsi(14) < 30


Exit String: rsi(14) > 70


When complete, your Strategy Setup should look like the following:



While there is more to be done, you've now created a strategy that has just one trading rule and uses static parameters.  Read on for more information on how to enhance this strategy.




Adding a Supporting Trading Rule


While a single trading rule is a good start, the use of supporting trading rules can greatly improve a trading strategy.  In our strategy thus far, we're entering positions only when the Relative Strength Index (RSI) is below 30.  We're now going to add a supporting trading rule to the Entry String so that, in addition to the RSI, the Chaikin Money Flow needs to be below zero.


We'll be using the Calculation Builder again, but you should first prepare the Entry String for another rule by appending the word 'and' followed by a space:



You can then click the Builder button below the Entry String, and we'll use the Calculation Builder to help us create the Chaikin Money Flow formula:



Select Chaikin Money Flow from the list, and then enter 14 for the Days parameter.  You can then click OK to transfer the formula back into the Entry String:



Finally, we need to specify that we want the Chaikin Money Flow (CMF) formula to be below zero for positions to be entered.  Thus, our complete Entry and Exit Strings will be:


Entry String: rsi(14) < 30 and cmf(14) < 0


Exit String: rsi(14) > 70


When complete, your Strategy Setup should look like the following:



We've now created a complex trading strategy comprised of multiple trading rules.  In the next step, we'll change the formula parameters to variables so that we can test a variety of parameter sets when we run this strategy.




Using Parameter Variables


One of the benefits of automation is that you can instruct StrataSearch to test a range of parameter values instead of having to change and test each parameter value manually.  This can save a considerable amount of time.


In this example, we'll be creating 3 variables that define: the number of days in the formulas, the RSI buy line, and the RSI sell line.  Click the Add button in the Variable section to add the following 3 variables. 





When complete, you should be able to see all 3 variables in the Variables listing:



Finally, we're going to use the keyboard and mouse to replace the values of 14 with @days.  We'll also be replacing the RSI crossover value of 30 in the Entry String with @buyline, and we'll be replacing the RSI crossover of 70 in the Exit String with @sellline


Thus, our complete Entry and Exit Strings will be:


Entry String: rsi(@days) < @buyline and cmf(@days) < 0


Exit String: rsi(@days) > @sellline


When complete your final Strategy Setup should look like the following:



We've now created a complex strategy containing multiple trading rules, and configured it with variables to test a range of parameter values.


The final step is to test our Entry and Exit Strings for errors.




Testing the Entry and Exit Strings


Before saving your Strategy Setup, it's always a good idea to test it for errors.  Click the Verify button directly beneath the Entry String to test the Entry String for errors.  If everything was entered correctly, you should receive the following String Verified message:



If your strategy contains errors, you'll need to go back and correct them.  Make sure your formula contains proper spacing.  If spaces aren't placed on both sides of the 'and' statement in the Entry String, StrataSearch might not recognize it.


Next, click the Verify button beneath the Exit String as well, to make sure that formula is also entered correctly.  When both the Entry and Exit String have been verified, you can click OK to save your Strategy Setup.


Congratulations, you have now created your first Strategy in StrataSearch.  As you can see, creating basic strategies is really quite simple.  In the next step, we'll see how to run our example strategy.


New Training Video! 

Click Here to see a training video of this step!


Next Step: Running Your Strategy


See AlsoStrategy Setups, Calculation Builder, Custom Formulas