Detrended Price Oscillator Strategy Backtest The Detrend Price Osc indicator is similar to a moving average,
in that it filters out trends in prices to more easily identify
cycles. The indicator is an attempt to define cycles in a trend
by drawing a moving average as a horizontal straight line and
placing prices along the line according to their relation to a
moving average. It provides a means of identifying underlying
cycles not apparent when the moving average is viewed within a
price chart. Cycles of a longer duration than the Length (number
of bars used to calculate the Detrend Price Osc) are effectively
filtered or removed by the oscillator.
You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
Centered Oscillators
Ergotic MACD Strategy Backtest This is one of the techniques described by William Blau in his book
"Momentum, Direction and Divergence" (1995). If you like to learn more,
we advise you to read this book. His book focuses on three key aspects
of trading: momentum, direction and divergence. Blau, who was an electrical
engineer before becoming a trader, thoroughly examines the relationship
between price and momentum in step-by-step examples. From this grounding,
he then looks at the deficiencies in other oscillators and introduces some
innovative techniques, including a fresh twist on Stochastics. On directional
issues, he analyzes the intricacies of ADX and offers a unique approach to help
define trending and non-trending periods.
Blau`s indicator is like usual MACD, but it plots opposite of meaningof
stndard MACD indicator.
You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
Elder Ray (Bear Power) Strategy Backtest Developed by Dr Alexander Elder, the Elder-ray indicator measures buying
and selling pressure in the market. The Elder-ray is often used as part
of the Triple Screen trading system but may also be used on its own.
Dr Elder uses a 13-day exponential moving average (EMA) to indicate the
market consensus of value. Bear Power measures the ability of sellers to
drive prices below the consensus of value. Bear Power reflects the ability
of sellers to drive prices below the average consensus of value.
Bull Power is calculated by subtracting the 13-day EMA from the day's High.
Bear power subtracts the 13-day EMA from the day's Low.
You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
CCI Strategy Reversed Backtest The Commodity Channel Index (CCI) is best used with markets that display cyclical or
seasonal characteristics, and is formulated to detect the beginning and ending of these
cycles by incorporating a moving average together with a divisor that reflects both possible
and actual trading ranges. The final index measures the deviation from normal, which indicates
major changes in market trend.
To put it simply, the Commodity Channel Index (CCI) value shows how the instrument is trading
relative to its mean (average) price. When the CCI value is high, it means that the prices are
high compared to the average price; when the CCI value is down, it means that the prices are low
compared to the average price. The CCI value usually does not fall outside the -300 to 300 range
and, in fact, is usually in the -100 to 100 range.
You can change long to short in the Input Settings
Please, use it only for learning or paper trading. Do not for real trading.
JC_MacD_RSI_Candle_Strat_public//
// Author : Jacques CRETINON
// Last Version : V1.0 11-22-2016
//
// Risk disclaimer : Do not use this script in production environment. We assume no liability or responsibility for any damage to you, your computer, or your other property, due to the use of this script.
//
// Purpose of this script :
// 1- use same pine code for strategy or study script (with simple modifications)
// 2- be able to send alerts : enterlong, entershort, exitlong, exitshort, stoplosslong, stoplossshort, takeprofitlong, takeprofitshort in a study script like a strategy script should do
// 3- do not repaint (I HOPE)
//
// RoadMap :
// 1- manage : Trailing Stop Loss and Trailing Stop Loss offset
//
// I use this script :
// 1- with default value for XAUUSD, current chart resolution : 1mn, large timeframe : 15mn.
// 2- That's why I hard code MACD5 (5mn average), MACD15 (15mn average), MACD60 (1h average) ...
// 3- MACD, RSI (1mn and 15mn) and Candles info are my inputs to take any decisions
//
// I do not publish my enterLong, enterShort, exitLong and exitShort conditions (lines 204 to 207 are sample !) as they are not as perfect as I'd like. Fell free to use your own conditions :)
//
// Please, report me any bug, fell free to discuss and share. English is not my natural language, so be clement ;) Happy safe trading :)
Normalized MACD (v420) strategyNormalized MACD but heavily modified for example hullMA instead of EMA
the strategy
MACD+STOCHASTICA simple strategy that use MACD and STOCHASTIC to give buy/sell signal. Use fractals to put stop loss
MACD + RSI TSA simple strategy that use EMAs convergence/divergence and RSI peeks to take position. Fractals are really useful to positioning your stop loss.
It works well on commodities and forex markets.
Unemployment Momentum ModelThis model uses a Smoothed RSI to measure the momentum of the Civilian Unemployment Rate as published by FRED. The behavior of the unemployment rate makes it ideal for applying momentum-based timing techniques because it tends to rise sharply in a short time period and then declines gradually over a longer period. Using other basic momentum-based timing techniques also works well (e.g., EMA crossover, MACD, ROC, etc.)
Please note that you cannot trade the unemployment rate directly. This model is meant to help you understand the state of the current economy in the context of unemployment.
Ichimoku + Daily-Candle_X + HULL-MA_X + MacDIchimoku_cloud + Daily-Candle_cross(DT) + HuLL-MovingAverage_cross + MacD
any timeframe, all indicators settings adjustable for fine tuning to pair/timeframe
Target Point and Stop Loss settings
set SL low to reduce repaint
PPO Bull/Bear Divergence to High/Low StrategyA simple strategy that uses the PPO divergences to open trades and the highs/lows to close them. Credit to Pekipek for this PPO Divergence indicator (I changed the visuals a bit)
STRATEGY
Purple circle - bullish divergence - enter LONG
Orange circle - bearish divergence - enter SHORT
Green dot - high point - exit LONG
Red dot - low point - exit SHORT
That's it. Not very profitable, but I like Pekipek's indicator a lot so figured I'd see what a strategy was like. Would love to see any variations.
MACDouble & StochRSI w/ safeties and variable time interval v0.3UPDATE:
IMPORTANT!!! MAKE SURE "RECALCULATE AFTER ORDER FILLED" IS CHECKED. I will have it on by default in the future.
This is a continuation of my previous scripts of two MACD indicators with a Stochastic RSI indicator.
New features:
- Alternate MACD time interval
You can now set the time interval for the second MACD indicator to a different resolution than the displayed chart.
Uncheck the box and select the desired interval. For example, if your chart is set to 15min then first MACD will be set at 15 min and you can select 5 min for the second MACD.
- Alternate StoRSI time interval
You can (and should) set the StochRSI to a different time interval as well. StochRSI hasn't worked great with previous versions. Now you can set it to a different time resolution as well. I strongly recommend you set it at a higher (slower) resolution; for example if your chart is set at 15min then you should test setting the StochRSI at 30 or 45min.
- ' True" StochRSI logic
Trading logic for StochRSI is now a true StochRSI, instead of just reading "k" and ignoring "d", K now has to be greater than D to buy and less than to sell.
- Safeties
A primitive but low risk safety in the form of an uptrend/downtrend price safety. If current close+high isn't greater than the previous close and high then the buy order will not be executed. The same applies for sell orders.
- Cap on losses from short positions
A stop loss safety set to 9000 for exiting sell positions. This will need refinement in the future but this puts a cap on losses from any sell position. At an initial currency of 10,000 this translates to 90.00. If it is giving you problems simply delete line 78 from the source code.
Please feel free to ask any questions or send me suggestions. This is still very much a work in progress and I'll try to polish up the rough spots but it is fully functional. With a slower StochRSI and the safeties I have gotten it to consistently outperform the old 2x MACD strategy script---typically by 3-fold.
MTF MACD 2 By YuthavithiIf you want a good strategy without repaint. This one might be for you. Excellent profitable for BTCUSD3M for OKCoin.
It uses multiple time frame MACD for trading decision. To avoid repaint, set the delay period = 1 for both long term and midterm.
The idea is that, if long term, mid term and current time frame all agree on traidng direction, the trade will take place.
I also uses it in my automated trading bot with good result.
www.tradingview.com
MultiCross v4.20Quad-HullMA-cross & VWMA & MacD & TSI combination
Version 4.20
added script for strategy settings to be already correct when strategy loads onto chart:
calc_on_order_fills= true, calc_on_every_tick=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, pyramiding=0
MultiCrossQuad-HullMA-cross & VWMA & MacD & TSI combination
Made for 4H - other timeframes unkown result.
Momentuminator 1.0Here we have a general purpose momentum based long and short flip flop with optional profit target and maximum loss.
Program development: Boffin Hollow Lab
Author: Tarzan at tradingview.com
Release: Version 1.0 May 2016
Please Note: Past Performance is not necessarily indicative of future results
MACDouble + RSI (rec. 15min-2hr intrv) Uses two sets of MACD plus an RSI to either long or short. All three indicators trigger buy/sell as one (ie it's not 'IF MACD1 OR MACD2 OR RSI > 1 = buy", its more like "IF 1 AND 2 AND RSI=buy", all 3 match required for trigger)
The MACD inputs should be tweaked depending on timeframe and what you are trading. If you are doing 1, 3, 5 min or real frequent trading then 21/44/20 and 32/66/29 or other high value MACDs should be considered. If you are doing longer intervals like 2, 3, 4hr then consider 9/19/9 and 21/44/20 for MACDs (experiment! I picked these example #s randomly).
Ideal usage for the MACD sets is to have MACD2 inputs at around 1.5x, 2x, or 3x MACD1's inputs.
Other settings to consider: try having fastlength1=macdlength1 and then (fastlength2 = macdlength2 - 2). Like 10/26/10 and 23/48/20. This seems to increase net profit since it is more likely to trigger before major price moves, but may decrease profitable trade %. Conversely, consider FL1=MCDL1 and FL2 = MCDL2 + (FL2 * 0.5). Example: 10/26/10 and 22/48/30 this can increase profitable trade %, though may cost some net profit.
Feel free to message me with suggestions or questions.
Forex Master v2.0 (EUR/USD)This is version 2 of my Forex Master algorithm originally posted here:
BACKTEST CONDITIONS:
Initial equity = $100,000 (no leverage)
Order size = 100% of equity
Pyramiding = disabled
TRADING RULES:
Long entry = EMA5(RSI20) cross> 50
Profit limit = 50 pips
Stop loss = 50 pips
Short entry = EMA5(RSI20) cross< 50
Profit limit = 50 pips
Stop loss = 50 pips
Long entry = Short exit
Short entry = long exit
DISCLAIMER: None of my ideas and posts are investment advice. Past performance is not an indication of future results. This strategy was constructed with the benefit of hindsight and its future performance cannot be guaranteed.
SPY Master v1.0This is a simple swing trading algorithm that uses a fast RSI-EMA to trigger buy/cover signals and a slow RSI-EMA to trigger sell/short signals for SPY, an xchange-traded fund for the S&P 500.
The idea behind this strategy follows the premise that most profitable momentum trades usually occur during periods when price is trending up or down. Periods of flat price actions are usually where most unprofitable trades occur. Because we cannot predict exactly when trending periods will occur, the algorithm basically bets money on all trade opportunities during all market conditions. Despite an accuracy rate of only 40%, the algorithm's asymmetric risk/reward profile allows the average winner to be 2x the average loser. The end result is a positive (profitable) net payout.
TRADING RULES:
Buy/Cover = EMA3(RSI2) cross> 50
Sell/Short = EMA5(RSI2) cross< 50
BACKTEST SETTINGS:
- Period = March 2011 - Present
- Initial capital = $10,000
- Dividends excluded
- Trading costs excluded
PERFORMANCE COMPARISON:
There are 657 trades, which means 1,314 orders. Assuming each order costs $2 (what I pay for at Interactive Brokers), total trading costs should be $2,628.
-SPY (buy & hold) = 132.73 ---> 193.22 = +45.57% (dividends excluded)
-SPY Master v1.0 = $12,649 - $2,628 = $10,021 = +100.21%
DISCLAIMER: None of my ideas and posts are investment advice. Past performance is not an indication of future results. This strategy was constructed with the benefit of hindsight and its future performance cannot be guaranteed.
MACD + Stochastic, Double Strategy (by ChartArt)This strategy combines the classic stochastic strategy to buy when the stochastic is oversold with a classic MACD strategy to buy when the MACD histogram value goes above the zero line. Only difference to the classic stochastic is a default setting of 71 for overbought (classic setting 80) and 29 for oversold (classic setting 20).
Therefore this strategy goes long if the MACD histogram goes above zero and the stochastic indicator detects a oversold condition (value below 29). If the inverse logic is true, the strategy goes short (stochastic overbought condition with a value above 71 and the MACD histogram falling below the zero line value).
Please be aware that this pure double strategy using simply two classic indicators does not have any stop loss or take profit money management logic.
All trading involves high risk; past performance is not necessarily indicative of future results. Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not actually been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
Forex Master (EUR/USD)ATTENTION:
This is a symmetrical algorithm designed only for trading EUR/USD on the 1h time frame. For other currency pairs and time frames, you need to re-calibrate the RSI-EMAs as well as the profit targets and stop losses.
BACKTEST CONDITIONS:
Initial equity = $100,000 (no leverage)
Order size = 100% of equity
Pyramiding = disabled
TRADING RULES:
Long entry = EMA20(RSI10) cross> 50
Profit limit = 50 pips
Stop loss = 50 pips
Short entry = EMA30(RSI30) cross< 50
Profit limit = 50 pips
Stop loss = 50 pips
Long entry = Short exit
Short entry = long exit
DISCLAIMER: None of my ideas and posts are investment advice. Past performance is not an indication of future results. This strategy was constructed with the benefit of hindsight and its future performance cannot be guaranteed.
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.