McClellan Oscillator StrategyBuy and sell programs when 5 day EMA goes above and below zero, respectively.
Useful for LEVERAGED ETF trading such as SPXL, TECL, FNGU, etc. Not so much for general portfolio holdings.
M-oscillator
Combo Backtest 123 Reversal & Moving Average Envelopes This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Moving Average Envelopes are percentage-based envelopes set above and
below a moving average. The moving average, which forms the base for
this indicator, can be a simple or exponential moving average. Each
envelope is then set the same percentage above or below the moving average.
This creates parallel bands that follow price action. With a moving average
as the base, Moving Average Envelopes can be used as a trend following indicator.
However, this indicator is not limited to just trend following. The envelopes
can also be used to identify overbought and oversold levels when the trend is
relatively flat.
WARNING:
- For purpose educate only
- This script to change bars colors.
Momentum Strategy (BTC/USDT; 1h) - MACD (with source code)Good morning traders.
It's been a while from my last publication of a strategy and today I want to share with you this small piece of script that showed quite interesting result across bitcoin and other altcoins.
The macd indicator is an indicator built on the difference between a fast moving average and a slow moving average: this difference is generally plottted with a blue line while the orange line is simply a moving average computed on this difference.
Usually this indicator is used in technical analysis for getting signals of buy and sell respectively when the macd crosses above or under its moving average: it means that the distance of the fast moving average (the most responsive one) from the slower one is getting lower than what it-used-to-be in the period considered: this could anticipate a cross of the two moving averages and you want to anticipate this potential trend reversal by opening a long position
Of course the workflow is specularly the same for opening short positions (or closing long positions)
What this strategy does is simply considering the moving average computed on macd and applying a linear regression on it: in this way, even though the signal can be sligthly delayed, you reduce noise plotting a smooth curve.
Then, it simply checks the maximums and the minimums of this curve detecting whenever the changes of the values start to be negative or positive, so it opens a short position (closes long) on the maximum on this curve and it opens a long position (closes short) on the minimum.
Of course, I set an option for using this strategy in a conventional way working on the crosses between macd and its moving average. Alternatively you can use this workflow if you prefer.
In conclusion, you can use a tons of moving averages: I made a function in pine in order to allw you to use any moving average you want for the two moving averages on which the macd is based or for the moving average computed on the macd
PLEASE, BE AWARE THAT THIS TRADING STRATEGY DOES NOT GUARANTEE ANY KIND OF SUCCESS IN ADVANCE. YOU ARE THE ONE AND ONLY RESPONSIBLE OF YOUR OWN DECISIONS, I DON'T TAKE ANY RESPONSIBILITY ASSOCIATED WITH THEM. IF YOU RUN THIS STRATEGY YOU ACCEPT THE POSSIBILITY OF LOOSING MONEY, ALL OF MY PUBBLICATIONS ARE SUPPOSED TO BE JUST FOR EDUCATIONAL PURPOSES.
IT IS AT YOUR OWN RISK WHETHER TO USE IT OR NOT
But if you make money out of this, please consider to buy me a beer 😜
Happy Trading!
Delta-RSI Strategy (with filters)Delta-RSI Strategy (with filters):
This is a version of the Delta-RSI Oscillator strategy with several criteria available to filter entry and exit signals. This script is also suitable for backtesting over a user-defined period and offers several risk management options (take profit and stop loss).
Since the publication of the Delta-RSI Oscillator script, I have been asked many times to make it compatible with the Strategy Tester and add filtering criteria to minimize "false" signals. This version covers many of these requests. Feel free to insert your favorite D-RSI parameters and play around!
ABOUT DELTA-RSI
Delta-RSI represents a smoothed time derivative of the RSI designed as a momentum indicator (see links below):
INPUT DESCTIPTION
MODEL PARAMETERS
Polynomial Order : The order of local polynomial used to interpolate the relative strength index (RSI).
Length : The length of the lookback frame where local regression is applied.
RSI Length : The timeframe of RSI used as input.
Signal Length : The signal line is a EMA of the D-RSI time series. This input parameter defines the EMA length.
ALLOWED ENTRIES
The strategy can include long entries, short entries or both.
ENTRY AND EXIT CONDITIONS
Zero-crossing : bullish trade signal triggered when D-RSI crosses zero from negative to positive values (bearish otherwise)
Signal Line Crossing : bullish trade signal triggered when D-RSI crosses from below to above the signal line (bearish otherwise)
Direction Change : bullish trade signal triggered when D-RSI was negative and starts ascending (bearish otherwise)
APPLY FILTERS TO
The filters (described below) can be applied to long entry, short entry and exit signals.
RELATIVE VOLUME FILTER
When activated, the D-RSI-driven entries and exits will be triggered only if the current volume is greater than N times the average over the last M bars.
VOLATILITY FILTER
When activated, the D-RSI-driven entries and exits will be triggered only if the N-period average true range, ATR, is greater than the M-period ATR. If N < M, this condition implies increasing volatility.
OVERBOUGHT/OVERSOLD FILTER
When activated, the D-RSI-driven entries and exits will be triggered only if the value of 14-period RSI is in the range between N and M.
STOP LOSS/TAKE PROFIT
Fixed and trailing stop loss as well as take profit options are available.
FIXED BACKTESTING START/END DATES
If the checkboxes are not checked, the strategy will backtest all available price bars.
Combo Backtest 123 Reversal & MA Displaced EnvelopeThis is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Moving Average Displaced Envelope. These envelopes are calculated
by multiplying percentage factors with their displaced expotential
moving average (EMA) core.
How To Trade Using:
Adjust the envelopes percentage factors to control the quantity and
quality of the signals. If a previous high goes above the envelope
a sell signal is generated. Conversely, if the previous low goes below
the envelope a buy signal is given.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Money Flow Indicator This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Indicator plots Money Flow Indicator (Chaikin). This indicator looks
to improve on Larry William's Accumulation Distribution formula that
compared the closing price with the opening price. In the early 1970's,
opening prices for stocks stopped being transmitted by the exchanges.
This made it difficult to calculate Williams' formula. The Chaikin
Oscillator uses the average price of the bar calculated as follows
(High + Low) /2 instead of the Open.
The indicator subtracts a 10 period exponential moving average of the
AccumDist function from a 3 period exponential moving average of the
AccumDist function.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Modified Price-Volume Trend This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The related article is copyrighted material from
Stocks & Commodities.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & MASS Index This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The Mass Index was designed to identify trend reversals by measuring
the narrowing and widening of the range between the high and low prices.
As this range widens, the Mass Index increases; as the range narrows
the Mass Index decreases.
The Mass Index was developed by Donald Dorsey.
WARNING:
- For purpose educate only
- This script to change bars colors.
Jim's MACDMACD Buy/Sell Strategy
Filters bearish crossovers above the 0 line and bullish crossovers below.
Uses 34 ema to further filter the trades and take only longs above and only shorts below.
Apply at least 2:1 risk to reward ratio to account for losing trades.
Trade at own risk!
RSI Classic Strategy (by Coinrule)One of the questions hobbyist traders more often ask is: what is the perfect trading indicator?
Every indicator is just a tool, so its efficiency is proportional to your ability to read its signals and translate them into an actionable trading strategy. The RSI is likely the most flexible and easy to use among the technical indicators.
This trading strategy tries to catch short-term swings on the coins of your choice with a simple yet profitable setup.
Buy when the RSI is lower than 30 (you can adjust it to 35 in times of steep uptrend).
Sell when the RSI is greater than 65 (the target may range between 60 and 75 depending on the volatility of the coin).
Note that the buy signal comes when the indicator crosses below 30 and not when it crosses above 30 as it happens on the built-in RSI strategy on Tradingview.
The present script overperforms the built-in strategy, even adding trading fees and using a lower amount of capital for each trade (30%). That means that the system can deliver higher net-profits with lower risk levels.
A typical example of market conditions where this strategy works perfectly is as follows.
The first initial breakout indicates that a new leg up in the trend may start. Bitcoin starts to trade within a range which you can identify when it reaches the point 3. That is the perfect time to start the rule because
- trading within a channel anticipates possible swings up and down
- the trend is on the upside, providing low downside risk in buying the dips.
This strategy works well with selected coins of your choice, and it's a great fit on leverage exchanges like Binance Futures.
If you prefer to run it across all available coins on the market, instead, you may choose an optimized version.
Combo Backtest 123 Reversal & Martin Pring's Special K This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Pring's Special K is a cyclical indicator created by Martin Pring.
His method combines short-term, intermediate and long-term velocity
into one complete series. Useful tool for Long Term Investors
Modified for any source.
WARNING:
- For purpose educate only
- This script to change bars colors.
Buy and Hold entry finder StrategyHello everyone!
I proudly present the backtest Strategy Script for my "Buy and Hold entry finder" Script.
It basically shows you the outcome, if you would use my indicator in the past.
The buy signals are limited to 1 order per month.
Order Size: Allows you to choose, how much money you want to invest per month. (Please consider, it will only invest an x amount per Order, but it will not stack the amount you did not invest in an previous month ) (Example in my indicator)
Pyramiding: Just regulates, how often you can open an position.
Commission: Here you can set how much it will cost to open an position at your broker.
I coded a feature that allows you to set a Start Date and an End Date for your backtest. In the end of the backtest the script closes all positions.
If you got any question, feel free to ask in the comments or send me a message.
Sincerely, RS Titan.
RSI-VWAP Indicator %█ OVERALL
Simple and effective script that, as you already know, uses vwap as source of the rsi, and with good results as long as the market has no long-term downtrend.
RsiVwap = rsi (vwap (close), Length)
The default settings are for BTC in a 30 minute time frame. For other pairs and time frames you just have to play with the settings.
█ FEATURES
• The option to start trading from a certain date has been added.
• To make the profit more progressive, a percentage of your equity is used for entries and a percentage of your position is used for closings.
• The option to trade in Spot mode has been added, since, for the TradingView backtest, the money is infinite and if you do not limit it somehow,
it would offer you much better profits than the live trading.
QuantityOnLong = Spot ? (EquityPercent / 100) * ((strategy.equity / close) - strategy.position_size) : (EquityPercent / 100) * (strategy.equity / close)
• The option to stop the system when the drawdown exceeds the fixed limit has been added.
Drawdown, as you already know, is a very important measure of risk in trading systems.
The maximum drawdown will tell us what the maximum loss of a trading system has been during a period. This maximum loss is determined by:
strategy.risk.max_drawdown(Risk, strategy.percent_of_equity)
• Leverage plotted on labels added.
█ ALERTS
To enjoy the benefits of automatic trading, TradingView alerts can be used as direct buy-sell orders on spot, or long-close orders with leverage.
Currently there are Chrome extensions that act as a bridge between TradingView and your Exchange or Broker.
This is an example of syntax for this type of extensions. Copy and paste a message like this into the alert window:
{{strategy.order.action}} @ {{strategy.order.price}} | e = {{exchange}} a = account s = {{ticker}} b = {{strategy.order.action}} {{strategy.order.alert_message}}
█ NOTE
Certain Risks of Live Algorithmic Trading You Should Know:
• Backtesting cannot assure actual results.
• The relevant market might fail or behave unexpectedly.
• Your broker may experience failures in its infrastructure, fail to execute your orders in a correct or timely fashion or reject your orders.
• The system you use for generating trading orders, communicating those orders to your broker, and receiving queries and trading results from your broker may fail.
• Time lag at various point in live trading might cause unexpected behavior.
• The systems of third parties in addition to those of the provider from which we obtain various services, your broker, and the applicable securities market may fail or malfunction.
█ THANKS
Thanks to TradingView, its Pine code, its community and especially those Pine wizards who post their ideas that helps us to learn.
If the world is heading toward a equitable new world economic order, let's get rich first ...
Happy trading!
Oscillator Evaluator (Analysis tool)Oscillator Evaluator (Analysis tool)
The oscillator evaluator is a tool that will help you analyse and compare the oscillator of your choice to another 2 oscillators.
By selecting the strategy with which you will analyze the oscillators, you will be able to see the behaviour of the oscillators in different aspects.
First there is a moving average increase or decrease strategy, that will give you a good idea of the correlation of the oscillator with the price.
The second is a commom 2 MA crossover strategy, that will give you and idea of the validaty of that oscillator as a strategy or as a trend filter.
The third strategy is a cross over 0 signal, that will go long on a crossover of 0 and short on a crossunder 0. This helps you see how good is the oscillator at evaluating suport and resistance areas and give you an idea of its balance.
The forth strategy is a Buy/Sell on extremes of the oscillator and will let you know how good is your strategy at spotting good places to buy and sell.
The fith strategy is to evaluate how goood the oscillator is as a mean reversion filter or how good it is at spotting small price changes.
The sixth strategy is similar to the last but is focused on how good is the oscillator spotting good places to take profits on trending strategies.
The 6 strategies in the script produce signals from the oscillator and from the oscillator only.
In conclusion this tool can be used to measure your oscillator and see if it really is as good as you think in comparison to others.
This script is not intended to be used as a full strategy but as a tool.
MA Divergences StrategyThis is the Strategy version of the Study I published. It is a Moving Average that can be applied to any plot to plot divergences on any oscillator, as well as perform backtesting. You'll need a REALLY good oscillator to perform live trades using this alone, but I think it is a valuable tool and had the Strategy hanging around and for some reason didn't upload it yet.
So here it is.
Turn Length to 1 to follow the oscillator without lag. Turn Length up if you are getting too many false signals or tweak the original oscillator settings.
Super Momentum StrategyThis is a strategy utilizing multiple of Evergets RMI (thanks to him for permission to publish) and a Chance Momentum.
It buys when 4 of the RMIs are below their thresholds and sells when they are above. There is a 5th one I added last night that works in Reverse - buy when its above and sell when below, which should work better for pyramiding strats by using it at the right rate to set the overall trend.
Very basic sample below, I could have set it up better as my example but just want to publish.
Combo Backtest 123 Reversal & Market Facilitation Index This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The Market Facilitation Index is an indicator that relates price range to
volume and measures the efficency of price movement. Use the indicator to
determine if the market is trending. If the Market Facilitation Index increased,
then the market is facilitating trade and is more efficient, implying that the
market is trending. If the Market Facilitation Index decreased, then the market
is becoming less efficient, which may indicate a trading range is developing that
may be a trend reversal.
WARNING:
- For purpose educate only
- This script to change bars colors.
RMI + Triple HMRSI + Double EVWRSI + TERSI + CMO StrategyThis is a strange experimental strategy WIP that I decided to upload an early version to share some of what I am working on. Just one script of a few.
It combines Chande Momentum with RMI and some weird ones I am experimenting with - Triple Hull MA RSI, Double Exponential + Volume Weighted RSI, Triple Exponential RSI. And to top it off, a final oscillator that combines the THMRSI with the RMI.
The main intention here, currently, is to test the usefulness of each on different timeframes and values. Currently it is considered to buy when all are below their threshold and sell when all are above, with the chande momentum crossing its line as the final confirmation.
For now there is no individual for each of the unique elements included. I am going to likely use this is a working house project to test other experimental indicators in the future.
It may be some of these are better suited for long term but I do think they have valid uses in checking short and long term momentum at the very least.
I copied the RMI from Everget.
[DS]Entry_Exit_TRADE.V01-StrategyThe proposal of this script is to show the possible trading points of BUY and SELL based on the 15-minute chart of the Nasdaq Future Index. The start point of the strategy was schedule for 2021/01/01 and until the time of this publication (2021/01/31), for 1 index contract the results presented area a Gross Profit of 2.97% with a Net Profit of 1.35%.
█ FEATURES
The indicator shows on the graph the position of the MACD and TSI indicators that are the places of strength among Buyers and Sellers.
It's possible to observe a sharp fall or rise in the price of these positions.
On the current candle, a label is displayed containing the value of the William %R Mod indicator, which will display the OverBought position (dark red) and OverSold position (dark green). The other colors like light red and green are the regions where the price makes the decision of which direction to go.
There are also other indicators:
a) The positions of the BUY (light green) and SELL areas (light red);
b) The label with the position of BUY (dark green) and SELL (dark red) with the line that connects these points;
c) DEMA 72 (orange);
d) EmaOchl4 in the color green for BULL and red for BEAR market;
e) Pivots high and low
f) Maximum (purple light) and minimum areas (blue light)
█ FUNCTIONS AND SETTINGS
The indicator uses the following functions:
(1) DEMA - Double Exponential Moving Average (08,17,34, 72)
(2) ema () - Exponential Moving Averge (72, ohlc4)
(3) plot()
(4) barcolor()
(5) cross()
(6) pivots ()
(7) William R% Md (OverBought = -7, OverSold=-93)
(8) Maximum and Minimum Value
(9) fill()
(10) macd () - Moving Average Convergence Divergence (Fast Lengt=12, Slow Length=26, Source=close, Signal Smoothing=9)
(11) tsi() - Trading Strenght Indicator==> Índice de Força Real ( IFR ) (Long Length=72, Short Length=17, Signal Length=17)
(12) Buy and Sell TRADE Points
█ PERFORMANCE AND ERRORS
The positions of BUY and SELL points are defined through the crossing of the Dema 34 candles with the Ema Ohcl4. As it is an indicator, it can present different positions from de market direction. Thus there is a need to observe the direction of the market in order to verify whether the indicate decision is really acceptable. The decision to BUY or SELL an asset must be well studied to avoid financial losses. The indicator will only help you in this decision, is your responsibility the decision of entering or leaving an asset.
█ THANKS TO
PineCoders for all they do, all the tools and help they provide, and their involvement in making a better community. All the PineCoders, Pine Pros, and Pine Wizards, people who share their work and knowledge for the sake of it and helping others, I'm very happy and grate full indeed.
█ NOTE
If you have any suggestions for improving the script or need help using it, please send a message in the comments
MACD controlled risk strategy exampleUsing a basic MACD as a signal this code is an example of how to base strategies around stops and calculated risk per trade rather than the more common approach of 'equity flipping' long and short for every trade and using an arbitrary %age stop which can leave you a bit exposed, lead to excessive drawdown and miss out on bigger sized positions for more profits.
Combo Backtest 123 Reversal & Line Regression Intercept This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Linear Regression Intercept is one of the indicators calculated by using the
Linear Regression technique. Linear regression indicates the value of the Y
(generally the price) when the value of X (the time series) is 0. Linear
Regression Intercept is used along with the Linear Regression Slope to create
the Linear Regression Line. The Linear Regression Intercept along with the Slope
creates the Regression line.
WARNING:
- For purpose educate only
- This script to change bars colors.