Simple Long Short SMA CrossOver
Author: stevecle
Creation Date: 8/15/2011 9:59 PM
profile picture

stevecle

#1
How can I adapt the existing SMA Crossover Code (Strategy = "Moving Average Crossover Long") to ALSO go short when the fast sma crosses the slow sma (and cover the short when the opposite occurs). In other words, a stock will always be either long or short. Many Thanks!

CODE:
Please log in to see this code.
profile picture

Eugene

#2
This is called a stop-and-reverse (SAR, always in market) system and is illustrated in this Wealth-Lab Wiki Knowledge Base article:

WealthScript Techniques | Creating a Stop-And-Reverse (SAR) system
profile picture

stevecle

#3
Thank you Eugene - I'll check it out.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).