50/150 moving average, index (ETF) trend following robot. Coded for people who cannot psychologically handle dollar-cost-averaging through bear markets and extreme drawdowns (although DCA can produce better results eventually), this robot helps you to avoid bear markets. Be a fair-weathered friend of Mr Market, and only take up his offer when the sun is shining!...
I found this strategy on internet, in a well-known forex forum.
I have translated the two indicators mentioned in that strategy (originally in mq4) in pine script.
Thanks to Fractured and Shizaru for the FRAMA snippets, to mejialucas for Supertrend snippet, to JayRogers for trade management snippet and to Trost for backtesting snippet.
I also added...
This strategy is based on the slope of the EMA130.
Over that slope, the script calculates two EMAs (9,21) which are used to generate the main entry and exit signal.
In particular, the strategy enters a LONG position when EMA9 > EMA21. On the contrary, it closes the LONG and opens a SHORT when EMA9 < EMA21.
When the slope of the EMA130 is rising, it means that...