OPEN-SOURCE SCRIPT

Moving Average Rainbow (Stormer)

This strategy is based and shown by trader and investor Alexandre Wolwacz "Stormer".

Overview
The strategy uses 12 moving averages (default EMA) to identify trends and generate trading signals opening positions.
Allowing to select the type of moving average and length to be used.
The conditions includes relationship between moving averages, the position of the current price relative to the moving averages, and the occurrence of certain price patterns.

Calculation
  • The mean moving averages is calculated by adding all the 12 moving averages and dividing by 12, the value is used to help to identify trend and possible condition to open position.
  • The 12 moving averages is spliced by 3 ranges, initial range (moving average lines 1 to 4), middle range (moving average lines 5 to 8) and end range (moving average lines 9 to 12). These ranges helps to identify potential trend and market turn over.
  • The moving average touch price is a relationship between the low price (uptrend) or high price (downtrend) with the moving average lines, it identifies where the price (low/high) has reached the the moving average line. Fetching the value to help for opening position, set stop loss and take profit.
  • Since the stop loss is based and set from the previous moving average touch price value, when position is about to be open and setting the stop loss value, there is a verification to check both current and previous moving average touch price to recalculate the stop loss value.
  • The turnover trend checks for a possible market turnover event, setting up a new profit target, this setting when enabled is to be helpful when a turnover occurs against the position to exit position with some profit based on highest high price if long or lowest low price if short.
  • The turnover signal is similar to turnover trend. The difference is that when this setting is enabled and it triggers, it simply exit the current position and opens up a reverse position, long goes short and short goes long. And there is an complement optional that checks current price exit profitable.


Entry Position
Long Position:
  • Price is higher than the mean moving averages. Meaning possible uptrend.
  • The lines of the middle range from the moving averages are in increasing order. Meaning possible uptrend.
  • The current high pierced up previous high.
  • Fetch the previous value of the moving average touch price. Meaning the low price has touched one of the moving average lines, which that value is conditioning to open position.


Short Position:
  • Price is lower than the mean moving averages. Meaning possible downtrend.
  • The lines of the middle range from the moving averages are in decreasing order. Meaning possible downtrend.
  • The current low pierced down previous low.
  • Fetch the previous value of the moving average touch price. Meaning the high price has touched one of the moving average lines, which that value is conditioning to open position.


Risk Management
Stop Loss:
  • The stop loss is based from the previous moving average touch price value, high price for short and low price for long or occurs an verification to check for both current and previous moving average touch price value and a recalculation is done to set the stop loss.


Take Profit:
  • According to the author, the profit target should be at least 1:1.6 the risk, so to have the strategy mathematically positive.
  • The profit target is configured input, can be increased or decreased.
  • It calculates the take profit based on the price of the stop loss with the profit target input.


Turnover Trend
Long Position:
  • The moving averages initial range lines signals a possible market turnover. Meaning long might be going short.
  • Fetches the highest high hit since the opening of the position, setting that value to the new profit target.


Short Position:
  • The moving averages initial range lines signals a possible market turnover. Meaning short might be going long.
  • Fetches the lowest low hit since the opening of the position, setting that value to the new profit target.
alexandrewolwaczExponential Moving Average (EMA)Moving AveragesstormerTrend Analysistrendfollower

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal