Can someone give me formula for b-testg success of crossover a 16 and 9 SMA on a 5 minute basis for ES #F (S&P Emini). Would like to gage success rate/probablity for buy/selling scalping strategy when the 16 sma crosses the 9sma and visa versa. Thank you.
Announcement
Collapse
No announcement yet.
Need formula for b-testing SMA cross-overs for SP Emini 5 minute
Collapse
X
-
tmike66
If you are unfamiliar with programming in efs then the best way to start is with the Formula Wizard which makes it a relatively easy task to write formulas such as the one you are looking for.
The first step is to create the two averages that you will be using for the back test.
Once you have those then you can start setting your conditions. The first condition is to go long at the Open if at the completion of the prior bar the faster moving average crossed the slower moving average. Notice that in the conditions I first check that I am not already long so as not to trigger multiple signals/trades
Then I apply the same logic for the short trades.
At this point I add another couple of conditions to paint the bars in blue when long and red when short so as to have a visual confirmation of the trades on the chart. Lastly I add one condition that is always true by definition to paint the bars in black in case the strategy is neither long not short.
Then I assign the studies to be plotted on the chart.
The complete efs is attached to this post. You can use the Formula Wizard to modify the script.
For instructions on how to use the Formula Wizard you may want to read the Formula Wizard Guide which is available in the EFS KnowledgeBase.
Beyond this if you are interested in further developing this and/or other formulas and strategies I would suggest that you begin by reviewing the JavaScript for EFS video series. That will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS and Back Testing.
If instead you are not interested in developing formulas and strategies on your own (or learning how to do it) then you may want to consider contacting an EFS Consultant
AlexAttached Files
Comment