Kaufman's Efficiency Ratio Strategy [KL]I recently published an indicator called "Kaufman's Efficiency Ratio Indicator". In the description of that script, I hypothesized about how the Efficiency Ratio could be applied to identify bullish moves in instances where price had already gone up steeply, but rests for a while, allowing for entry in expectation that price will continually rise. I decided to test out this idea with Pinescript.
About Kaufman's Efficiency Ratio ("ER")
ER was developed by a systematic trader by the name of Perry J. Kaufman.
Formula
The formula is:
= A divided by B,
where:
A = Current closing price minus the closing price at the start of the lookback period
B = Sum of differences between closing prices (in absolute terms) of consecutive bars over the lookback period
How this strategy enters a trade (Long):
- code: entry_signal_long = ER > 0 and ER_is_mid
- meaning: when ER is positive, strategy assumes price has risen. Usually ER value begins high (red), and unless it is a false move, then it should stay positive. This strategy will patiently wait until ER drops to medium (yellow), and then place a trade.
- how low/medium/high is dynamically determined: Refer to the description of my other script("Kaufman's Efficiency Ratio Indicator") for details. Trying to keep this as short as possible.
How this strategy exits a trade (Long):
- when price hits stop limit; stop limit is based on low of bars, trails upward based on ATR
- included a feature called "tightening TSL", which tries to reduce the stop-buffer during periods of high volatility implied by ER (very experimental, opening the floor for suggestions on how this can be improved)
Trend Analysis
Three EMAs Trend-following Strategy (by Coinrule)Trend-following strategies are great because they give you the peace of mind that you're trading in line with the market.
However, by definition, you're always following . That means you're always a bit later than your want to be. The main challenges such strategies face are:
Confirming that there is a trend
Following the trend, hopefully, early enough to catch the majority of the move
Hopping off the trade when it seems to have run its course
This EMA Trend-following strategy attempts to address such challenges while allowing for a dynamic stop loss.
ENTRY
The trading system requires three crossovers on the same candle to confirm that a new trend is beginning:
Price crossing over EMA 7
Price crossing over EMA 14
Price crossing over EMA 21
The first benefit of using all three crossovers is to reduce false signals. The second benefit is that you know that a strong trend is likely to develop relatively soon, with the help of the fast setup of the three EMAs.
EXIT
The strategy comes with a fixed take profit and a volatility stop, which acts as a trailing stop to adapt to the trend's strength. That helps you get out of the way as soon as market conditions change. Depending on your long term confidence in the asset, you can edit the fixed take profit to be more conservative or aggressive.
The position is closed when:
The price increases by 4%
The price crosses below the volatility stop.
The best time frame for this strategy based on our backtest is the 4-hr. Shorter timeframes can also work well, although they exhibit larger volatility in their returns. In general, this approach suits medium timeframes. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
You can execute this strategy on your favourite exchange at coinrule.com
3x Supertrend and Stoch RSIBased on the strategy if Trade pro "HIGHEST PROFIT Triple Supertrend Trading Strategy Proven 100 Trade Results"
Your entry long signal will show when two of the three supertrend are green and the stochastic rsi cross up and the candle is above the ema
Your entry short signal will show when two of the three supertrend are red and the stochastic rsi cross down and the candle is below the ema
You can change the settings of the three supertrend and the stochastic rsi
Daily HIGH/LOW strategyThis is a DAILY High/LOW strategy combined with a moving average and volume for more accuracy.
The rules are simple :
For long if we had a cross of the high with the previous high and close of the candle is above moving average and chaikin money flow volume is positive we have a long entry.
We exit when we cross down the moving average with the close of the candle.
For short if we had a crossdown of the low with the previous low and close of the candle is below moving average and chaikin money flow volume is negative we have a short entry.
We exit when we cross above the moving average with the close of the candle.
This strategy has no risk management inside so use it with caution.
If you have any questions, let me know
VCP pivot buyIt will buy the breakout of the pivot in a bullish trend which is defined by the Mark Minervini stage 2 template
Set the stop loss% and Target% in your favor ( recommend the stoploss% as the low percentile atrp )
It helps indicate the contraction point so that we can have a low-risk entry of a buy point.
It followed the strategy of Mark Minervini.
changing the lookback period input to change the percentile
changing the Pivot Length to decide how many bars you would consider as a pivot
changing the Close range to decide in how much percentage does the close range you would consider as a pivot
The percentile rank is represented in the colour of the background, you can alter how low you want to set to indicate lowering volatility.
The blue line shows the percentage range in ( pivot length) days/bars
The coloured background shows the signal of pivot point forming
Linear SSL ShortThis script consist of two parts: linear SSL and DEMA. The difference between original SSL and current is that it calculated by linear regression. The logic is simple: when SSL "crossunder" and DEMA is above the price - we get short signal. When price became above DEMA and SSL "crossover" - close short.
Aphrodite// v4
// continuation of prime number checker with strat commands and normal distribution theory put in
//pump/dump trend following strategy idea added.
//Pseudo Random Number Generator Box Muller Normal Distribution Method - code from Function - Functions to generate Random values by RicardoSantos. Dots are calculated by an adaptation of the ideas
//in this script.
// volume accumulates when dots are green for buys, red for sells. This setup is just looking for buys but this is very easy to change
//just go to trading day and swap all strategy.long commands for strategy.short commands
// Exits on minutes where OHLC all return 'primeness'
//Reinforced dots (with black) when last three dots are all of same colour
SQV CrossThis strategy is used to find tickers that do well when SPY and QQQ are up and VIX is down. This uses EMA's on the user defined resolution to define direction of each ticker. Trades are entered upon crossover. EMAs are user defined as well.
MA&AOThat is quit simple strategy, which combines only two indicators: AO and MA. The logic of trades is also clear, when AO is bullish; slow ma is under the close price; fast ma > slow ma - buy.
8 Day Extended Runs Inspired by Linda Bradford Raschke.
Strategy suited to the US T-note (ZN1!) with a t-test of 4.06.
The 5 day SMA is vital to Linda’s trend identification system. She’s done extensive testing and research using this indicator and has built models based on it. Linda used the 5 day SMA to determine that large outlier price moves happen in the direction of the trend in each market about 9-10 times per year. The powerful part about that number is that when the trend does persist, it can go on a long run, making this a trade with a high expected value.
Note: the current exit criteria is sell 10 days after entry, users should experiment with different stop placements.
BarUpDn Long StrategyThis is a bar up/down strategy for going long only where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
BarUpDn StrategyThis is a bar up/down strategy where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
Up/Down Long StrategyThis is a consecutive bar up/down strategy for going long only where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
Up/Down StrategyThis is a consecutive bar up/down strategy where you can specify how many bars up to buy and how many bars down to sell. It also has code to check and make sure the condition is still true when launching the official alert, which helps back testing and live results line up, however be sure to enter commission and slippage into the properties to accurately reflect profits. I added back testing date ranges to this so you can easily pull up and see back tested results for a certain date range. I also added a buy and sell message fields in the properties so you can launch alerts that will work with automated trading services. Simply enter your buy message and sell message into those fields in the properties and then when you create an alert enter {{strategy.order.alert_message}} into the alert body and it will dynamically pull in your buy and sell messages when it fires alerts.
Moon Phases Strategy 2015 till 2021Moon Phases Strategy
Thank you to Author: Dustin Drummond for allowing me to use his Moon Phase strategy code and modify it. I wanted to test out the accuracy of the moon phase. And I could not have done it without his code
It was created to test the Moon Phase theory compared to just a buy and hold strategy.
It buys on full Moon and sells on the new moon. I also have added the ability to add stop loss and target profit if anyone wants to tinker with it. This strategy uses hard-coded dates from 1/1/2015 until 12/31/2021 only! Any dates outside of that range need to be added manually in the code or it will not work.
I may or may not update this so please don't be upset if it stops working after 12/31/2021.
Feel free to use any part of this code and please let me know if you can improve on this strategy.
Result:
50% accurate using data from 2015 till today.
I find a buy and hold strategy to have outperformed the moon phase.
It does have its value. It might be used as a confluence with other established indicators.
robotrading bodyThis is a very simple and universal strategy. Good for crypto. For BTC/USD, shitcoin/BTC.
Strategy
Long positions only. If the candle is falling and the candle body is 3 or more times the average candle body, then open a long position.
If the candle is rising, we should close a long position.
Short positions are not used.
This is a counter-trend strategy.
The average body of a candlestick is the arithmetic average of the bodies of the previous 100 bodies.
Parameters
The multiplier is the number of times the candlestick body should be bigger than the average candlestick body to get a signal to open a long position.
Recommended
- A timeframe of 4 hours to 1 day
- Cryptocurrencies with large market capitalization
- you can use coin/USD, coin/USDT, coin/BTC, coin/ETH, etc
DCA Bot Long/Short Thanks to @TheTradingParrot for the inspiration and knowledge shared.
Thanks to @ericlin0122 for the original DCA Bot Emulator which is the backbone of this strategy.
The script simulates DCA strategy with parameters used in 3commas DCA bots for futures trading. Experiment with parameters
to find your trading setup.
Beware how large your total leveraged position is and how far can market go before you get liquidated!
Do that with the help of futures liquidation calculators you can find online!
I`ve added:
1) an internal average price and profit calculating, instead of TV`s native one, which is subject to severe slippage.
2) I`ve built a graphic interface, so levels are clearly visible and back-test analyzing made easier.
3) now both Long & Short direction of the strategy exist.
4) trailing TP which was featured in the initial script has been removed because TV`s execution model makes
it impossible to know how the real world trailing would have unfolded.
5) the table is self explanatory, and it is there to help you discover what happened and where.
6) vertical colored lines appear when the new maximum deviation from the original price has
been reached
All the trading happens with total account capital, and all order sizes inputs are expressed in percent.
Known issues:
When deviation is small, and the same candle triggers safety AND the close order, the initial orders are closed, but a
new one opens on the next candle. This is "resolved" by closing the unwanted trade forcefully on the next candle, affecting
profit calculating minimally and guaranteeing that what should be closed has been closed.
The code could be improved through use of arrays, making the table flexible so the number of rows should be dynamic depending
on the number of SOs.
!!!!! IMPORTANT!!!!!
This strategy script is made to receive a signal from an exterior study script, which should plot +100 for long or -100 for short
entry (that is by default - values can be changed in the strategy settings menu). That plot should be found in "Enter Trigger" input
dropdown menu at the bottom of strategy settings menu. Removing the "and trigger == long/short_trigger" condition from strategy entry
conditions makes the strategy open trades ASAP.
Cheers!
Combo Backtest 123 Reversal & T3 Averages 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
This indicator plots the moving average described in the January, 1998 issue
of S&C, p.57, "Smoothing Techniques for More Accurate Signals", by Tim Tillson.
This indicator plots T3 moving average presented in Figure 4 in the article.
T3 indicator is a moving average which is calculated according to formula:
T3(n) = GD(GD(GD(n))),
where GD - generalized DEMA (Double EMA) and calculating according to this:
GD(n,v) = EMA(n) * (1+v)-EMA(EMA(n)) * v,
where "v" is volume factor, which determines how hot the moving average’s response
to linear trends will be. The author advises to use v=0.7.
When v = 0, GD = EMA, and when v = 1, GD = DEMA. In between, GD is a less aggressive
version of DEMA. By using a value for v less than1, trader cure the multiple DEMA
overshoot problem but at the cost of accepting some additional phase delay.
In filter theory terminology, T3 is a six-pole nonlinear Kalman filter. Kalman
filters are ones that use the error — in this case, (time series - EMA(n)) —
to correct themselves. In the realm of technical analysis, these are called adaptive
moving averages; they track the time series more aggres-sively when it is making large
moves. Tim Tillson is a software project manager at Hewlett-Packard, with degrees in
mathematics and computer science. He has privately traded options and equities for 15 years.
WARNING:
- For purpose educate only
- This script to change bars colors.
Average Highest High and Lowest Low Swinger StrategyThis is a full price action strategy designed for trending markets such as crypto and stocks.
Its purely made on calculations for the highest high and lowest low using 2 different length , a faster and a slower one.
With those we make multiple averages.
Rules for entry:
For long: our close of the candle is above both the average using fast and slow line
For short: our close of the candle is below both the average using fast and slow line
Rules for exit
We always exit when we have an opposite order
Caution
This strategy use no risk management system, so be careful with it
If you have any questions, let me know
Combo Backtest 123 Reversal & Stochastic Crossover 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
This back testing strategy generates a long trade at the Open of the following
bar when the %K line crosses below the %D line and both are above the Overbought level.
It generates a short trade at the Open of the following bar when the %K line
crosses above the %D line and both values are below the Oversold level.
WARNING:
- For purpose educate only
- This script to change bars colors.
ICHIMOKU Crypto Swing StrategyThis is a crypto swing strategy designed for timeframes bigger than 1h.
The main components are
ICHOMOKU
KDJ
Average High
Average Low
Rules for entry
For long: we have the ichimoku crosses between tenkan and baselines, we have a rising kdj line and at the same time we have a increase in the average high
For short: we have the ichimoku crosses between tenkan and baselines, we have a falling kdj line and at the same time we have an increase in the average low
Rules for exit
We exit when we have inverse conditions than the initial ones used for entry.
Caution
This strategy does not use a risk management, so be careful with it !
If you have any questions let me know !
MACD + DMI Scalping with Volatility Stop by (Coinrule)Trend-following strategies are cool because they allow you to catch potential high returns.
The main limit of such strategies are:
False signals > the asset is not experiencing a strong trend. The strategy gets stuck with a sideways move or, worst, with the beginning of a downtrend.
The sell signal may come later than the actual top, leading in some cases to turn a trade in profit into a loss.
This strategy tries to address these limitations to develop a trading system that optimises the entry and closes trade once the profit achieves a pre-set level.
ENTRY
The trading system uses the MACD and the DMI to confirm when is the best time for buying. Combining these two indicators prevents trading during downtrends and reduces the likelihood of getting stuck in a market with low volatility.
The system confirms the entry when:
The MACD histogram turns bullish.
When the positive DMI is greater than the negative DMI, there are more chances that the asset is trading in a sustained uptrend.
EXIT
The strategy comes with a fixed take profit combined with a volatility stop, which acts as a trailing stop to adapt to the trend's strength. Depending on your long term confidence in the asset, you can edit the fixed take profit to be more conservative or aggressive.
The position is closed when:
The price increases by 3%
The price crosses below the volatility stop.
The best time frame for this strategy based on our backtest is the 3-hr . The 4-hr can work well. In general, this approach suits medium to long term strategies
The strategy assumes each order to trade 30% of the available capital to make the results more realistic. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
Swing Stock Market Multi MA Correlation This is a swing strategy adapted to stock market using correlation with either SP500 or Nasdaq, so its best to trade stocks from this region.
Its components are
Correlation Candle
Fast moving average to choose from SMA , EMA , SMMA (RMA), WMA and VWMA
Medium moving Average to choose from SMA , EMA , SMMA (RMA), WMA and VWMA
Slow moving average to choose from SMA , EMA , SMMA (RMA), WMA and VWMA
Rules for entry
Long: fast ma > medium ma and medium ma > slow ma
Short: fast ma< medium ma and medium ma < slow ma.
Rules for exit
We exit when we receive an inverse condition.
Caution:
This strategy use no risk management inside, so be careful with it .
If you have any questions, let me know !