GMS: Mean Reversion StrategyThis is based on my GMS: Mean Reversion Indicator ()
Features:
- % Based Profit Target and Stop Loss
- SMA Trend Filter
- Can choose trade exit based off a moving average or linear regression curve
- Filter for long only trades, short only trades, or both at the same time.
Source code is open, so feel free to take a look!
I hope it helps,
Andre
Meanreversion
MA strategyTrading strategy on moving averages. Based on Mean reversion. These algorithmic strategies are based on a concept that assumes a regular return of the price to a certain average level, provided that a sufficiently long time distance is considered. The main objective of such strategies is to determine the expected level of price return. Interconnected with Envelopes.
Trend Following or Mean RevertingThe strategy checks nature of the instruments. It Buys if the close is greater than yesterday's high, reverse the position if the close is lower than yesterday's low and repeat the process.
1. If it is trend following then the equity curve will be in uptrend
2. If it is mean reverting then the equity curve will be downtrend
Thanks to Rayner Teo.
Mean Reversion Strategy by KrisWatersThis is a type of mean reversion strategy. It only generates long signals when the price is far away from the mean. It tries buy from the dip. Use it with BTC/USDT pair on 4 hour timeframe.
Global Market Signals: Is the Trend Your Friend? AlgorithmWelcome!
This is a fully customizable strategy to help generate great trade signals as well as provide basic analysis on any market of your choice. All the trades occur at the open of a candle.
Settings:
1. Long or Short
2. Look back length
3. New Highs or New Lows?
4. Trade Duration
5. Trend SMA Length
6. Above or Below Trend SMA
Example:
Using a Daily SPY chart.
The Default Settings are:
1. Long
2. 10
3. New Lows
4. 5
5. 200
6. Above
What this means is that you will be going long when there is a new 10 day lowest close, you'll hold the trade for 5 days, and the trades only occur above the 200 day simple moving average.
**When you test your settings, make sure that in the Properties tab, you have the "Order Size" set at 100 and in the drop down menu to the right, make sure "% of equity" is selected.**
Bollinger Band Strategy (Basic) Version 1 This strategy is for learning purposes only. Pay special attention to these strategies on longer aggregation periods (like 1 hr chart or more). Don't expect accurate results when you set a limit to 10 cents above your entry to be accurate. For example if you set the chart to 1 day, the price may move down and hit a stop 10 times then tag your limit. If this doesn't make sense, just don't use strategies here. Learn more first. That being said, I don't have specific recommendations for each aggregation period, backtesting isn't always perfect.
Now then, this strategy can be used as the traditional BB method by setting the "Stop" and "Limit Out" to like 10000, check "Reversal Entry" and uncheck "Limit Time of Day" This will keep the strategy running just reverse your position when price crosses outside each band.
INPUTS:
Length - length of WMA that I used for mean of Bollinger Band (this may suppose to be SMA, too bad)
Source - O-H-L-C basis for WMA
Deviation - normal Standard deviation that would be set when using Bollinger Band
Trailing stop check box - your stop value will be either a hard stop or trailing stop for an exit
Stop - the stop value - remember you can set this really high and it won't stop out
Limit Out - the limit value for exit
Reversal Entry check box - This changes each entry from a reversal (traditional idea of BB) to enter a trend trade - hopefully version 2 will have choice to trend one direction and reversal in the other.
Limit Time of Day - Especially when trading futures, you may want to only trade a specific time of day, when this box is checked, you can set the entry times below, exit will still only occur based on limit/stop or a flip entry order (the opposite entry condition is met)
Tips:
when I don't know a thing about a price range, like gold. I can set the limit out to 10000 and play with a trailing stop to get a better idea of what is even possible before tuning further.
Fibonacci Camarilla Pivot Points Strategy Prototype
Camarilla pivot points with level 5 and another level 3 based on 1.618 added
Option to toggle regular Camarilla or Fibonacci based Camarilla pivot points
Option to toggle labels, candle overlay, levels, and more
Camarilla pivot points have greatly interested me due to the extremely choppy nature of the cryptocurrency market when it isn't going through a bull run. Camarilla pivot points aren't traditional pivots; the hlc3 of the previous candle close is the basis for each level, as the inventor felt that mean reversion to that previous value was likely.
Farooq: Bollinger Bands StrategyBollinger Band Strategy developed as a service and published for customer verification and acceptance.
If you are interested in development sevices, please either DM me or visit the Backtest Rookies webiste. If you are looking for free and open source scripts, there are some avaible both on the site and our Tradingview profile.
Overview
Bollinger Strategy base
Added additional, customizable 2nd and 3rd deviation levels
Added ability to switch between long only, short only or long & short strategies
Added option to select which deviation level to buy at
Added option to select which deviation level to sell at
Mean-Reversion Swing Trading Strategy v1A port of the TradeStation EasyLanguage code for a mean-revision strategy described at
traders.com
"In “Mean-Reversion Swing Trading,” which appeared in the December 2016 issue of STOCKS & COMMODITIES, author Ken Calhoun
describes a trading methodology where the trader attempts to enter an existing trend after there has been a pullback.
He suggests looking for 50% pullbacks in strong trends and waiting for price to move back in the direction of the trend
before entering the trade."
See Also:
- 9 Mistakes Quants Make that Cause Backtests to Lie (blog.quantopian.com)
- When Backtests Meet Reality (financial-hacker.com)
- Why MT4 backtesting does not work (www.stevehopwoodforex.com)
EMA, SMA Mean ReversionInvite Only: But everyone will be accepted
Invite-only in order to understand demand and interest in this type of strategy. All requests are welcome and will be accepted.
Full Source is available
A blog post containing full source code and commentary of the strategy is available on the backtest-rookies website. To comply with house rules, I cannot post a direct link here. (Hint add ".com" to backtest-rookies)
Overview
The strategy uses two moving averages to represent the historical mean and a slightly smoothed version of the current price action. It will place long or short trades when the fast EMA moves far away from the historical mean (the slow SMA).
Features
Set Backtest Date ranges
Enter when EMA is x% away from the mean
Independent inputs for the long and short side
Only enter when the EMA has started to reverse. (Input)
Optional Stop loss
Limit trades to a single direction to "Buy the dip" or "Sell the top"
Forex Master v4.0 (EUR/USD Mean-Reversion Algorithm)DESCRIPTION
Forex Master v4.0 is a mean-reversion algorithm currently optimized for trading the EUR/USD pair on the 5M chart interval. All indicator inputs use the period's closing price and all trades are executed at the open of the period following the period where the trade signal was generated.
There are 3 main components that make up Forex Master v4.0:
I. Trend Filter
The algorithm uses a version of the ADX indicator as a trend filter to trade only in certain time periods where price is more likely to be range-bound (i.e., mean-reverting). This indicator is composed of a Fast ADX and a Slow ADX, both using the same look-back period of 50. However, the Fast ADX is smoothed with a 6-period EMA and the Slow ADX is smoothed with a 12-period EMA. When the Fast ADX is above the Slow ADX, the algorithm does not trade because this indicates that price is likelier to trend, which is bad for a mean-reversion system. Conversely, when the Fast ADX is below the Slow ADX, price is likelier to be ranging so this is the only time when the algorithm is allowed to trade.
II. Bollinger Bands
When allowed to trade by the Trend Filter, the algorithm uses the Bollinger Bands indicator to enter long and short positions. The Bolliger Bands indicator has a look-back period of 20 and a standard deviation of 1.5 for both upper and lower bands. When price crosses over the lower band, a Long Signal is generated and a long position is entered. When price crosses under the upper band, a Short Signal is generated and a short position is entered.
III. Money Management
Rule 1 - Each trade will use a limit order for a fixed quantity of 50,000 contracts (0.50 lot). The only exception is Rule
Rule 2 - Order pyramiding is enabled and up to 10 consecutive orders of the same signal can be executed (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts).
Rule 3 - Every order will include a bracket with both TP and SL set at 50 pips (note: the algorithm only closes the current open position and does not enter the opposite trade once a TP or SL has been hit).
Rule 4 - When a new opposite trade signal is generated, the algorithm sends in a larger order to close the current open position as well as open a new one (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts. A Short Signal is generated shortly after the 14th Long Signal. The algorithm then sends in a sell order for 400,000 contracts to close the 350,000 contracts long position and open a new short position of 50,000 contracts).